How to Get Contract Deployers on VeChainThor

This guide shows you how to identify which addresses have deployed smart contracts on VeChainThor.
This is important for tracking developer activity, analyzing ecosystem growth, and building developer dashboards.

Reading Data from VeChainThor

Before we continue with Contract Deployers, we first have to set up the VeChain SDK to read blockchain data.

Initiating ThorClient

The ThorClient is your entry point for interacting with VeChainThor's blockchain. 

First, make sure you install the VeChain SDK:

npm install @vechain/sdk-core 
npm install @vechain/sdk-network

Initialize the Thor client:

import { ThorClient } from '@vechain/sdk-network';

Select Network

  • Mainnet - Use mainnet for all production-related activity

// Connect to mainnet
const thor = ThorClient.at("https://mainnet.vechain.org");
  • Testnet - Use testnet for testing and development purposes

// For testnet, use:
const thor = ThorClient.at("https://testnet.vechain.org");

Filter Raw Events (Find Contract Creation Logs)

To identify who deployed a contract, filter event logs and extract the deployer from the transaction receipt:

const contractAddress = '0x136522ab6ab75fb22ff79bbb15cf07d951d6c0be'

const filteredLogs = await thor.logs.filterRawEventLogs({
  criteriaSet: [{ address: contractAddress }],
});

console.log('Deployer', filteredLogs[0].meta.txOrigin);

How it works:

  1. filterRawEventLogs() queries events emitted by the specified contract address

  2. filteredLogs[0].meta contains metadata about the event, including txOrigin

  3. meta.txOrigin is the address that signed and submitted the transaction (the deployer)

The txOrigin field represents the EOA (Externally Owned Account) that initiated the transaction. This is different from gasPayer (used in fee delegation) and different from the contract address itself.

Getting Contract Address

Before tracking deployers, you need to identify which addresses are smart contracts. There are two methods:

1. Using Block Explorers

2. Check Using hasCode

const contract = await thor.accounts.getAccount(
  '0x0000000000000000000000000000456e65726779'
);
  • getAccount()- pulls the full state for the given address.

  • hasCode: true - indicates the address holds deployed bytecode (i.e. a contract).

  • hasCode: false - means it's an EOA (Externally Owned Account), controlled by a private key.

Getting Contract Addresses in Bulk

What if you don't know the contract address? You can discover contracts by scanning blocks:

  1. Get transaction logs from each block using getBlockCompressed()

  2. For each transaction in the block, verify if they originate from a contract or wallet using hasCode

  3. Once you have the contracts, use filterRawEventLogs() to fetch the deployer

You can learn more about the VeChain SDK in the Developer Fundamentals course.