Skip to main content

How to Audit ERC20, ERC721, and ERC1155 Token Activity

Updated on
Aug 07, 2026

24 min read

Overview​

In the dynamic landscape of blockchain technology, auditing firms face the crucial task of efficiently tracking and analyzing transactions on blockchain networks. This need becomes particularly concerning during tax assessments or when addressing inquiries from financial regulatory bodies. Traditional methods of accessing blockchain data can be intricate and time-consuming. To address this, we have developed a comprehensive guide utilizing Viem with a Quicknode endpoint and JavaScript, specifically tailored for EVM-compatible chains, including Ethereum, Polygon, and Avalanche. While the process becomes more efficient, the source of information is still the blockchain itself. Viem makes JSON-RPC calls to your Quicknode endpoint. This guide simplifies the process of conducting in-depth audits on wallet addresses.

Our step-by-step guide is designed to streamline the way auditing firms access and interpret blockchain transactions. For auditing firms embarking on the journey of blockchain data analysis, whether for routine compliance checks or regulatory responses, this guide is an essential resource. Quicknode's commitment to enhancing blockchain accessibility is evident in our continuous support and custom solutions.

If you encounter any challenges following this guide or require personalized assistance for your blockchain data retrieval needs, Quicknode's team is at your service. Contact us for expert guidance and support by using the feedback form in the Conclusion section.

What You Will Do​

In this guide, you will fetch all ERC20, ERC721, and ERC1155 transaction activities associated with a wallet, including:


  • Transaction history
  • Fungible token transfer history (ERC20)
  • Non-fungible token (NFT) transfer history (ERC721 and ERC1155)
  • Internal transaction history

What You Will Need​

It's helpful to have the following before you start, but it doesn't matter if you don't. We will show the installation stages of the project and the stages of getting an endpoint on Quicknode.


DependencyVersion
node.js^20
viem^2.0.0
fs-extra^11.1.1
cli-progress^3.12.0

Development​

Access to the Blockchain​

You'll need API endpoints to interact with the Ethereum network in order to query data from the blockchain. Create a free Quicknode account here, then log in and click the Create an endpoint button, then pick the chain and network based on your preferences.

In this guide, we will walk through how to get token activities from Avalanche C-chain. However, the code in this guide is applicable to all EVM compatible chains like Ethereum, Polygon, and Arbitrum. Whichever network you want to use, just use that HTTP Provider link after creating the endpoint. There is no additional change needed.

After creating your endpoint, copy the HTTP Provider link and keep it handy.

Quicknode Endpoint

Project Configuration​

Before diving into the coding, it is time to learn more about the libraries that are used in this project and their functionalities.

  • viem: The TypeScript interface used to make JSON-RPC requests, parse event ABIs, validate addresses, and format EVM values through your Quicknode endpoint

  • fs-extra: The file system module for file operations like writing to a file

  • cli-progress: The CLI progress bar module for visual progress feedback in the console

Now, let's start building the project.

Create a project directory and change the directory into it:

mkdir tokenActivities
cd tokenActivities

Then, initialize an npm project with the default options:

npm init --y

To install these libraries, we will use the node.js package manager, npm.

npm install viem cli-progress fs-extra

NOTE: After completing this step, insert "type": "module" into the package.json file just created. This enables the use of ES Module Syntax.

So, your package.json file should be similar to the one below.

{
"name": "tokenActivities",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license":