Execute
Utility functions for encoding and decoding ERC-7821 execute
function data.
Examples
Below are some examples demonstrating common usages of the Execute
module:
Encoding execute
Function Data
The execute
function data can be encoded using Execute.encodeData
.
import { Execute } from 'ox/erc7821'
const data = Execute.encodeData([
{
data: '0xcafebabe',
to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
value: 1n,
}
])
Decoding execute
Function Data
The execute
function data can be decoded using Execute.decodeData
.
import { Execute } from 'ox/erc7821'
const { calls } = Execute.decodeData('0xe9ae5c53...')
Functions
Name | Description |
---|---|
Execute.decodeBatchOfBatchesData | Decodes batches from ERC-7821 execute function data in "batch of batches" mode. |
Execute.decodeData | Decodes calls from ERC-7821 execute function data. |
Execute.encodeBatchOfBatchesData | Encodes calls for the ERC-7821 execute function with "batch of batches" mode. |
Execute.encodeData | Encodes calls for the ERC-7821 execute function. |
Types
Name | Description |
---|---|
Execute.Batch | |
Execute.Call |