Skip to main content
Version: 0.9

Add a new voucher

The DApp backend can call this method to add a new voucher when processing an advance-state request. Vouchers are collateral effects actionable in the blockchain. Between calls to the finish method, the voucher method can be called up to 32k times.

The returned value is the index of the voucher for the current advance-state request. In other words, the index counting restarts at every request.

Request Body
  • destination string

    20-byte address of the destination contract for which the payload will be sent.

  • payload string

    String in Ethereum hex binary format describing a method call to be executed by the destination contract. The first two characters are '0x' followed by pairs of hexadecimal numbers that correspond to one byte. For instance, '0xcdcd77c0' corresponds to a payload with length 4 and bytes 205, 205, 119, 192. To describe the method call, the payload should consist of a function selector (method identifier) followed by its ABI-encoded arguments. ref: https://docs.soliditylang.org/en/v0.8.19/abi-spec.html

Responses

Created the voucher.


Schema
  • index uint64

    Position in the Merkle tree.

© 2023 Cartesi Foundation Ltd. All rights reserved.

The Cartesi Project is commissioned by the Cartesi Foundation.

We use cookies to ensure that we give you the best experience on our website. By using the website, you agree to the use of cookies.