Deploying Token Registry (CLI)
For the current step, you can either opt to use the CLI or Code.
The token registry is a smart contract on the blockchain network that records the ownership and holdership information of a transferable record.
The Token Registry is a Soulbound Token (SBT) tied to the Title Escrow. The SBT implementation is loosely based on OpenZeppelin's implementation of the ERC721 standard. An SBT is used in this case because the token, while can be transferred to the registry, is largely restricted to its designated Title Escrow contracts.
In this guide, we will deploy a token registry smart contract on the Ethereum blockchain, sepolia network which is a test network that does not require actual ethers for transactions.
Prerequisite
- TrustVC CLI installed
- Private key to an Ethereum wallet with sufficient ethers
Deploying via TrustVC CLI
The TrustVC CLI uses an interactive prompt system that guides you through the deployment process. You can provide your wallet credentials via an encrypted wallet file, a private key file, or an environment variable.
Option 1: Using Environment Variable (Recommended)
Set your private key as an environment variable:
export OA_PRIVATE_KEY=<YOUR_PRIVATE_KEY_HEX>
Do not share your private key with anyone else!
Option 2: Using a Key File
Create a file key.txt with the private key of your Ethereum wallet and save it in your working directory. If you are using Metamask, you may retrieve this key from the extension in this guide.
Sample key.txt file content (replace with your private key):
<YOUR_PRIVATE_KEY_HEX>
Do not share this file with anyone else!
Deploying the token registry
Simply run the following command:
trustvc deploy token-registry
The CLI will interactively prompt you for:
- Network selection: Choose from available networks (e.g., sepolia, polygon-amoy)
- Registry name: Enter the name of the token registry (e.g., "My Token Registry")
- Registry symbol: Enter the symbol of the token registry (usually 3 characters, e.g., "MTR")
- Deployment type: Choose between standalone or factory deployment (default: factory)
- Wallet selection: Choose between encrypted wallet, private key file, or environment variable
Example session:
trustvc deploy token-registry
? Select a network: sepolia
? Enter the name of the token registry: My Token Registry
? Enter the symbol of the token registry: MTR
? Is this a standalone deployment? No
? Enter the token registry implementation address (optional, press Enter to use default):
? Enter the deployer contract address (optional, press Enter to use default):
? Select wallet type: Private Key File
? Enter the path to the private key file: ./key.txt
You should see a similar output when the deployment is successful:
ℹ info Deploying token registry My Token Registry
… awaiting Sending transaction to pool
… awaiting Waiting for transaction 0x7e3eea01c42bb10b3160f19c9f55fe3de24ed05abb9d6f4363c80c0d0f1be355 to be mined
✔ success Token registry deployed at 0x8431012Bc040942B59e3C5bf428221eab0b2f723
ℹ info Find more details at https://sepolia.etherscan.io/address/0x8431012Bc040942B59e3C5bf428221eab0b2f723
In this case, our contract has been successfully deployed on sepolia at the address 0x8431012Bc040942B59e3C5bf428221eab0b2f723.
Save your token registry address for future reference!
Congratulations! You have successfully deployed a token registry.
Next we take a look at configuring the DNS.