Deploy Registry Contract

Deploy Registry Contract


This guide covers the deployment of the ERC-6551 Registry contract for the purpose of interacting with TBAs (Tokenbound Accounts) on a local node OR if you want to enable TBAs for the first time on a new EVM chain. Otherwise, you may use the existing canonical ERC-6551 Registry contract.

The ERC-6551 Registry contract has already been deployed across several EVM networks. A list of deployed addresses can be found here.


  • foundry

    If you do not have foundry already:

    $ curl -L | bash
    $ foundryup
  • terminal

Clone the Reference repository

$ git clone

Make sure you checkout on v0.3.1 tag for the repository

This is ensures that the address of Registry contract is the same as on any other EVM compatible chain. The current address that’s deployed on all chains is: 0x000000006551c19487814612e58FE06813775758

$ git checkout tags/v0.3.1

If this address differs it would cause a tokenbound account associated with an NFT to have different addresses on different chains

Run the test and build the contracts

$ forge test
$ forge build

Compute the Registry address

This is to make sure it matches with 0x000000006551c19487814612e58FE06813775758

$ forge script script/ComputeRegistryAddress.s.sol:ComputeRegistryAddress

The output should be:

[⠒] Compiling... No files changed, compilation skipped Script ran successfully. Gas
used: 24925
== Logs ==

make sure the Address matches with 0x000000006551c19487814612e58FE06813775758


Before we can deploy we need to provide MAINNET_PRIVATE_KEY env variable - set this to your test account’s private key

$ forge script --fork-url <RPC_URL> script/DeployRegistry.s.sol --broadcast

replace <RPC_URL> with your chain's RPC endpoint

You may now use the address of the deployed ERC-6551 Registry contract to read the address of and deploy Tokenbound Accounts.