Documentation for Contract Interaction Processors in the EigenLayer-AVS system.
Contract Interaction Processors enable EigenLayer-AVS tasks to interact with Ethereum smart contracts. They provide the capability to both read state from contracts and execute state-changing transactions. These processors are critical components of the Task Engine's Virtual Machine (VM) that allow automated workflows to integrate with on-chain systems.
This page documents two specific processors:
For information about the Task Engine's Virtual Machine architecture, see Virtual Machine. For information about other processors such as REST API or JavaScript, see their respective pages (REST API Processor and JavaScript Processor).
Contract Interaction Processors are specialized components within the Task Engine's Virtual Machine that handle blockchain-specific operations. They translate task node definitions into Ethereum contract interactions and process the results.
Sources:
The Contract Read Processor allows tasks to query data from smart contracts without modifying state. It processes read-only calls to Ethereum contracts and converts the responses to a format usable within task execution flows.
Sources:
Contract Read Processor requires the following information in the task node definition:
| Parameter | Description |
|---|---|
| ContractAddress | Ethereum address of the contract to call |
| CallData | ABI-encoded function call data in hex format |
| ContractABI | JSON ABI definition for the function being called |
The processor returns the decoded data in a structured format that maintains the original Solidity types but converted to strings for large numbers to preserve precision.
ContractReadNode {
ContractAddress: "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
CallData: "0x70a08231000000000000000000000000ce289bb9fb0a9591317981223cbe33d5dc42268d",
ContractAbi: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"
}
Sources:
The Contract Write Processor executes state-changing transactions on Ethereum contracts. It uses Account Abstraction (ERC-4337) to manage transactions through smart contract wallets, enabling features like batched transactions and sponsored transactions.
The ContractWriteProcessor is defined in core/taskengine/vm_runner_contract_write.go21-39 and includes dependencies on the Ethereum client and smart wallet configuration.
Sources:
{{variable}})Sources:
The Contract Write Processor uses ERC-4337 Account Abstraction to execute transactions, which offers several advantages:
The processor handles UserOperation creation, bundling, submission, and receipt tracking. It uses the preset package from pkg/erc4337/preset to simplify UserOp management.
Sources:
The processor provides detailed transaction information in its output:
| Category | Fields |
|---|---|
| UserOperation | Sender, Nonce, InitCode, CallData, GasLimits, Fees, PaymasterData, Signature |
| Transaction Receipt | Hash, BlockInfo, Addresses, Gas Used, Status, Logs, etc. |
This data is stored in the task variables and can be used by subsequent nodes in the task flow.
Sources:
Both contract processors support templating within their input parameters. This allows dynamic values to be inserted at execution time:
ContractAddress: "0x{{contractAddress}}"
CallData: "0x70a08231000000000000000000000000{{userAddress}}"
The processors use the VM's preprocessing capabilities to substitute these variables with actual values from the task's execution context.
Sources:
Contract interactions can fail for various reasons (insufficient gas, reverted transactions, network issues). The processors handle these errors and provide detailed information in the execution step:
Sources:
Contract processors store their results in the VM's variable system, making the data available to subsequent nodes in the task graph:
r.SetOutputVarForStep(stepID, map[string]any{
"userOp": outputData.ContractWrite.UserOp,
"txReceipt": outputData.ContractWrite.TxReceipt,
})
This allows complex workflows that combine contract interactions with other processors like JavaScript, REST API calls, or branching logic.
Sources:
Feature this wiki to auto refresh weekly