Skip to content

Commit

Permalink
chore: rm executeVoucher pseudocode
Browse files Browse the repository at this point in the history
  • Loading branch information
masiedu4 committed Jul 24, 2024
1 parent 784ec74 commit 00f95f7
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions cartesi-rollups/tutorials/frontend-reactjs-wagmi-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -1630,33 +1630,5 @@ They are validated and executed on the blockchain using the [`executeVoucher(add

For example, users might generate vouchers to withdraw assets, which are executed on the base later.

```typescript



// sample code to execute a voucher

import { useWriteContract } from "wagmi";

const executeVoucher = async (voucher: any) => {
const { writeContractAsync } = useWriteContract();

if (voucher.proof) {
const newVoucherToExecute = { ...voucher };
try {
const hash = await writeContractAsync({
address, // CartesiDApp contract address
abi, // CartesiDApp contract
functionName: "executeVoucher",
args: [voucher.destination, voucher.payload, voucher.proof],
});
} catch (e) {
console.error("Error executing voucher:", e);
}
}
};

```

At this stage, you can now interact with the Cartesi backend using the frontend you've built.

0 comments on commit 00f95f7

Please sign in to comment.