Skip to content
Logo

encodeDelegateCallVoucher

Encodes a delegate call voucher as a DelegateCallVoucher call of the rollups contracts Outputs interface.

Usage

import {  } from "@cartesi/codec";
 
const  = ({
  : "0x0000000000000000000000000000000000000001",
  : "0xdeadbeef",
});
// "0x10321e8b..."

Parameters

  • destination (Address): address of the contract to be delegate-called.
  • payload (Hex | Uint8Array): calldata of the delegate call.

And an optional second parameter:

  • to ("hex" | "bytes", optional): representation of the encoded data. Defaults to "hex".

Return Type

Hex | Uint8Array: ABI-encoded output data, starting with the DelegateCallVoucher function selector (0x10321e8b).

Returns a Hex string by default, or a Uint8Array when to is "bytes".