githubEdit

Quiz-to-Earn Integration

Step-by-step guide for integrating Quiz-to-Earn into your application.


Prerequisites

  • Node.js 18+ installed

  • An EVM-compatible wallet (MetaMask, Rabby, etc.)

  • Access to Kasplex L2 Testnet network

  • Basic knowledge of React/Next.js and TypeScript


Installation

1. Install Dependencies

npm install wagmi viem @tanstack/react-query
# or
pnpm add wagmi viem @tanstack/react-query

2. Configure Wagmi

import { createConfig, http } from 'wagmi';
import {  } from 'wagmi/chains';

export const config = createConfig({
  chains: [],
  transports: {
    [.id]: http(),
  },
});

Contract Setup

Contract Address

Import ABI


Basic Usage

1. Read Contract Data

2. Write Contract Functions


Custom Hook Example


Error Handling


Complete Example


Network Compatibility

Quiz-to-Earn supports the following networks:

  • **** (Chain ID: 167012)

    • Contract: ``

    • RPC: https://evmrpc-testnet.kasplex.org

    • Explorer: https://explorer-testnet.kasplex.org


Troubleshooting

Common Issues

Issue: Transaction fails with "insufficient funds"

  • Solution: Ensure you have enough KAS for gas fees

Issue: Contract not found

  • Solution: Verify the contract address and network are correct

Issue: Function not found

  • Solution: Check that you're using the correct ABI and function name


Additional Resources


Last updated: 2025-11-13

Last updated