Skip to content

Types

Address

An Ethereum account address.

Imported from viem.

DelegateCallVoucher

A single-use permission to execute a DELEGATECALL instruction from the context of the Application contract.

type

  • Value: "delegatecallvoucher"

destination

The Ethereum address to be called, which is typically that of a smart contract.

payload

The data to be passed along the call, which typically encodes a Solidity function call.

Hex

A "0x"-prefixed string.

Imported from viem.

Input

An input added through the InputBox contract.

chainId

  • Type: bigint

The EIP-155 ID of the chain to which the InputBox contract was deployed.

appContract

The address of the Application contract to which the input is destined.

msgSender

The address of the account that called the addInput function on the InputBox contract. In the case of a deposit input, this should be the address of the appropriate portal contract.

blockNumber

  • Type: bigint

The number of the block in which the input was added.

blockTimestamp

  • Type: bigint

The timestamp of the block in which the input was added.

prevRandao

  • Type: bigint

The latest RANDAO mix of the post beacon state of the previous block. See EIP-4399 for notes on how to safely use this value as a source of randomness.

index

  • Type: bigint

The zero-based index of the input in the input box of the application.

payload

The actual data being transmitted to the application. From the perspective of the smart contracts and the node, this is an opaque blob. The application is free to specify any encoding for input payloads.

Notice

A piece of verifiable information.

type

  • Value: "notice"

payload

The actual data being notified by the application. From the perspective of the smart contracts and the node, this is an opaque blob. The application is free to specify any encoding for notice payloads.

Output

A union type of Notice, Voucher and DelegateCallVoucher.

You can them apart through the type property.

import { Output } from "@guidanoli/cmioc";
 
const handleOutput = (output: Output) => {
    switch (output.type) {
        case "notice": {
            const { payload } = output;
            break;
        }
        case "voucher": {
            const { destination, value, payload } = output;
            break;
        }
        case "delegatecallvoucher": {
            const { destination, payload } = output;
            break;
        }
    }
};

Voucher

A single-use permission to execute a CALL instruction from the context of the Application contract.

type

  • Value: "voucher"

destination

The Ethereum address to be called.

value

  • Type: bigint

The amount of Wei to be passed along to the call.

payload

The data to be passed along the call. If the destination address is that of a Solidity smart contract, this data generally encodes a Solidity function call.