Documentation

AvaxBurner Documentation

Complete guide to understanding and using AvaxBurner

Overview

AvaxBurner is a decentralized application built on the Avalanche C-Chain that helps users clean their wallets by burning unwanted spam tokens, rug pulls, and malicious NFTs.

The platform integrates with GoPlus Security API to provide real-time risk assessment of tokens and NFTs, allowing users to make informed decisions about which assets to burn. Users earn 25% gas rebates for every burn operation, incentivizing wallet hygiene.

Key Benefits

  • Automated risk detection for tokens and NFTs
  • Batch burning to save gas fees
  • 25% gas rebate system
  • Support for both ERC20 tokens and ERC721 NFTs
  • Works on Avalanche Mainnet and Fuji Testnet

Features

Risk Scanner

GoPlus API integration for real-time security analysis

Batch Operations

Burn multiple tokens/NFTs in one transaction

Gas Rebates

Earn 25% of gas fees back on every burn

Multi-Wallet Support

Core Wallet, MetaMask, WalletConnect

Network Flexibility

Switch between Mainnet and Fuji Testnet

Transaction History

Track all burns and rebates claimed

Architecture

AvaxBurner follows a modern three-tier architecture:

Frontend Layer

  • Next.js 16 App Router
  • React 19 with TypeScript
  • Tailwind CSS v4
  • shadcn/ui Components
  • Ethers.js v6

API Layer

  • Next.js API Routes
  • GoPlus Security API
  • Avalanche RPC
  • Asset Scanning
  • Transaction Handling

Smart Contract

  • Solidity ^0.8.20
  • OpenZeppelin Contracts
  • ReentrancyGuard
  • Batch Operations
  • Rebate System

The frontend communicates with the blockchain via ethers.js, while API routes handle external data fetching from GoPlus and the Avalanche network.

Smart Contract

The AvaxBurner smart contract is the core of the application, handling all burn operations and rebate distributions.

Contract Functions

burnTokens(address tokenAddress, uint256 amount)

Burn a single ERC20 token

batchBurnTokens(address[] tokenAddresses, uint256[] amounts)

Burn multiple ERC20 tokens in one transaction

burnNFT(address nftAddress, uint256 tokenId)

Burn a single ERC721 NFT

batchBurnNFTs(address[] nftAddresses, uint256[] tokenIds)

Burn multiple ERC721 NFTs in one transaction

claimRebate()

Claim accumulated gas rebates

getUserStats(address user)

Get burn count and pending rebates for a user

Security Features

  • ReentrancyGuard protection on all state-changing functions
  • OpenZeppelin battle-tested contracts
  • Require statements for input validation
  • Safe transfer patterns for ETH and tokens
  • Ownable pattern for administrative functions

Events

TokensBurned(address user, address token, uint256 amount, uint256 rebate)
NFTBurned(address user, address nft, uint256 tokenId, uint256 rebate)
RebateClaimed(address user, uint256 amount)

Frontend

The frontend is built with Next.js 16 and features a modern, responsive design.

Key Pages

/ - Landing pagePublic
/dashboard - Asset scanner and burn interfaceAuth Required
/history - Transaction historyAuth Required
/docs - DocumentationPublic

Key Components

WalletConnectModal

Multi-wallet connection dialog

AssetCard

Displays token/NFT with risk badge

BurnModal

Multi-step burn confirmation UI

useWallet

Global wallet state management

API Endpoints

The application exposes several API routes for blockchain interactions and data fetching.

POST/api/scan-assets

Scan wallet for tokens and NFTs with risk analysis

Body: { "address": "0x...", "network": "mainnet" }
POST/api/burn

Prepare burn transaction with gas estimates

Body: { "tokens": [...], "nfts": [...] }
GET/api/stats

Get global platform statistics

Returns: { "totalBurns", "totalRebates", "activeUsers" }
POST/api/claim-rebate

Claim accumulated gas rebates

Body: { "address": "0x..." }

Setup Guide

Prerequisites

  • Node.js 18+ and npm/yarn
  • MetaMask or Core Wallet browser extension
  • AVAX for gas fees (on mainnet or Fuji testnet)

Environment Variables

NEXT_PUBLIC_BURNER_CONTRACT_ADDRESS=0x...
NEXT_PUBLIC_GOPLUS_API_KEY=your_api_key
NEXT_PUBLIC_AVALANCHE_RPC=https://api.avax.network/ext/bc/C/rpc
NEXT_PUBLIC_FUJI_RPC=https://api.avax-test.network/ext/bc/C/rpc

Installation Steps

1. Clone the repository

git clone https://github.com/yourusername/avaxburner.git

2. Install dependencies

cd avaxburner && npm install

3. Deploy smart contract

cd contracts && npm install && npx ts-node scripts/deploy-contract.ts

4. Start development server

npm run dev

Usage Guide

Step-by-Step

1

Connect Your Wallet

Click "Connect Wallet" and select your preferred wallet provider (Core Wallet, MetaMask, or WalletConnect). Choose between Mainnet or Fuji Testnet.

2

Scan Your Assets

The dashboard automatically scans your wallet for all ERC20 tokens and ERC721 NFTs. Each asset is analyzed for security risks using the GoPlus API.

3

Select Assets to Burn

Use risk filters to quickly identify dangerous tokens. Click on assets to select them for burning. You can select multiple assets for batch operations.

4

Review and Burn

Click "Burn Selected" to review your transaction. Check gas estimates and expected rebates. Sign the transaction in your wallet to complete the burn.

5

Claim Your Rebates

After burning, your gas rebates accumulate in the smart contract. Visit your dashboard to claim your 25% gas rebates at any time.

Tips for Best Results

  • Use batch burning to minimize individual transaction costs
  • Focus on high-risk tokens first for safety
  • Let rebates accumulate before claiming to save on gas
  • Check transaction history to track your burns and rebates
  • Test on Fuji testnet before using mainnet

Ready to Start Burning?

Connect your wallet and clean your Avalanche portfolio today.