Creates an instance of DeployableTarget.
Optional
payload: DeployablePayloadOrAddress<EventActionPayload>Either a given implementation's initialization payload, or an address to an existing on chain target.
Optional
isBase: booleanA property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
Static
basesA static property representing a map of stringified chain ID's to the address of the base implementation on chain, used when cloning base contracts.
Static
registryThe target's registry type.
Readonly
abiReadonly
_isA property asserting that the protocol should eiher clone and initialize a new target from the base implementation, or re-use an existing contract without initializing.
Protected
_payloadThe deployable payload used either for contract construction or initialization
Protected
_configProtected
_addressThe internally managed address for this contract
Protected
Optional
_accountIf it exists, Viem Local Account, if in a Node environment
A getter that will return the base implementation's static addresses by numerical chain ID
A getter that returns the registry type of the base implementation
A getter returning this contract's deployed address, if it exists.
Gets a specific action event by index
The index of the action event to retrieve
Optional
params: Partial<Omit<ReadContractParameters, Gets all action events
Optional
params: Partial<Omit<ReadContractParameters, Retrieves the payload describing how claimants can be identified from logs or function calls.
Optional
params: Partial<Omit<ReadContractParameters, Executes a prepared event action
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Executes a prepared event action
Optional
params: Partial<Omit<UnionCompute<UnionStrictOmit<SimulateContractParameters<Abi, string, readonly unknown[], Chain, Chain, (`0x${string}` | Account)>, "chain">> & ChainIdParameter<Config, number> & ConnectorParameter, Derives the action claimant address from a transaction based on the provided ActionClaimant configuration.
This method supports both event-based and function-based claimant derivation.
Important: The claimant is considered to be transaction.from
when claimant.fieldIndex
is 255 using CheatCodes enum.
This may have unintended side effects for bridged transactions and SCW transactions, so these are considered unsupported use cases for the time being.
The configuration specifying how to derive the claimant.
Parameters for validation, including transaction hash, known signatures, logs, and chain ID.
The derived claimant address if found, undefined otherwise.
// Example usage
const eventAction = boost.action as EventAction
const claimant = await eventAction.getActionClaimant() // {
signatureType: SignatureType.EVENT,
signature: '0x1234...',
fieldIndex: 2,
targetContract: '0xabcd...',
chainid: 1
};
const params: ValidateActionStepParams = {
hash: '0x5678...',
chainId: 1,
knownSignatures: {
'0x1234...': {
type: 'event',
name: 'Transfer(...)'
}
}
};
const claimantAddress = await eventAction.deriveActionClaimantFromTransaction(claimant, params);
If the ABI for the specified signature is not found.
If there's an error decoding function data (for function-based derivation).
Validates the action claimant against the arguments of a log or function data.
The action claimant to validate.
Optional
logOrFnData: { Optional object containing the arguments to validate against.
The arguments from the log or function data.
The validated address if found and valid, otherwise undefined.
Retrieves action steps, and uses them to validate against, and optionally fetch logs that match the step's signature.
If logs are provided in the optional params
argument, then those logs will be used instead of fetched with the configured client.
Validates a single action step with a given criteria against logs or function calls.
If logs are provided in the optional params
argument, then those logs will be used instead of being fetched with the configured client.
For functions a hash is required.
The action step to validate. Can be a function of event step.
Additional parameters for validation, including hash, known events, logs, and chain ID.
Validates a single action event with a given criteria against logs.
If logs are provided in the optional params
argument, then those logs will be used instead of being fetched with the configured client.
The action step containing the event to validate.
Event logs to validate the given step against
Resolves to true if the action event is valid, throws if input is invalid, otherwise false.
Validates a single action function with a given criteria against the transaction input.
The action step containing the function to validate.
The transaction that will be validated against.
Optional
params: Pick<Parameters for validation.
Returns true if the action function is valid, false otherwise.
Validates a field against a given criteria.
The criteria to validate against.
The field value to validate.
Additional context for validation.
Validates a Log against a given criteria. If the criteria's fieldIndex is 255 (using CheatCodes enum), it is reserved for anyValidation
The criteria to validate against.
The Viem event log.
Validates a function's decoded arguments against a given criteria. If the criteria's fieldIndex is 255 (using CheatCodes enum), it is reserved for anyValidation
The criteria to validate against.
The decoded arguments of the function call.
Base parameter constructor, should return a partial viem.deployContract
parameters shape including abi, bytecode, and arguments, if any.
Expected to be overridden by protocol contracts.
Optional
_payload: EventActionPayloadOptional
_options: DeployableOptionsHigh level deployment function to deploy and await the contract address.
This is mainly a convenience method to easily deploy a contract, but will not initialize a Cloneable
,
which makes it useless for Boost components.
Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
Optional
payload: EventActionPayloadOptional
options: DeployableOptionsOptional
waitParams: Omit<WaitForTransactionReceiptParameters, "hash">The lower level contract deployment function that does not await for the transaction receipt.
This is mainly a convenience method to easily deploy a contract, but will not initialize a Cloneable
,
which makes it useless for Boost components.
Obviously you can ignore the TS warnings and use this, but you shouldn't in most all cases.
Optional
_payload: EventActionPayloadOptional
_options: DeployableOptionsCheck if the contract supports the given interface
The interface identifier
Optional
params: Partial<Omit<ReadContractParameters, Return a cloneable's unique identifier for downstream consumers to differentiate various targets All implementations must override this function
Optional
params: Partial<Omit<ReadContractParameters, Attaches a new payload for use with this deployable's initialization
Will set this contract's address and return the instance for chaining. Does not verify that provided address is valid.
Will set this contract's internal Wagmi Configuration and return the instance for chaining.
Utility function to validate the existence of an address on this Contract.
ContractAddressRequiredError if no address exists on this Contract instance
A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs].
Accepts eventName
and eventNames
as optional parameters to narrow the returned log types.
Optional
params: Omit<GetLogsParams<readonly [{ const logs = contract.getLogs({ eventName: 'EventName' })
const logs = contract.getLogs({ eventNames: ['EventName'] })
@public
@async
@template {ContractEvent} event
@template {ExtractAbiEvent<
ContractAbi,
event
>} [abiEvent=ExtractAbiEvent<ContractAbi, event>]
@param {?Omit<
GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,
'event' | 'events'
> & {
eventName?: event;
eventNames?: event[];
}} [params]
@returns {Promise<GetLogsReturnType<abiEvent, abiEvent
A typed wrapper for wagmi.watchContractEvent
Optional
params: Partial<Omit<UnionCompute<WatchContractEventParameters<readonly [{ Protected
validateProtected
Internal method used to ensure that a Wagmi configuration and payload are always present when deploying.
Optional
_payload: POptional
_options: DeployableOptionsProtected
optionallyProtected
awaitProtected
Optional
waitParams: Omit<WaitForTransactionReceiptParameters, "hash">
A generic event action
Export
EventAction