ton

TON supports multiple workchains - which one should I use in my code?


According to TON whitepaper, the TON blockchain network supports multiple chains.

What's the differences between these and which workchain should I use when deploying contracts or reading data from contracts?

When deploying my contract I must to specify which workchain I’m working on, I’m not sure which value to put there:

import { contractAddress } from "ton";

const workchain = ?;
const newContractAddress = contractAddress({ workchain, initialData: initDataCell, initialCode: initCodeCell });

Solution

  • TLDR

    For regular user work, always use workchain 0 - which is the workchain with workchain_id = 0

    What are the different chains in TON?