Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

docs: remove documentation for standalone token registry deployment #17

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ isRevokedBefore

#### Deploying Token Registry

This example provides how to deploy TradeTrust standard token-registry for [transferrable records](https://docs.tradetrust.io/docs/tutorial/transferable-records/overview/). It requires less gas compared to [standalone deployment](#deploying-standalone-token-registry), as it uses deployer and implementation addresses for deployment. Replace the values for `<your_private_key>` and `<your_provider_url>` with your wallet private key and the JSON RPC url for desired network accordingly. Currently, it supports the following networks.
This example provides how to deploy TradeTrust token-registry for [transferrable records](https://docs.tradetrust.io/docs/tutorial/transferable-records/overview/). Replace the values for `<your_private_key>` and `<your_provider_url>` with your wallet private key and the JSON RPC url for desired network accordingly. Currently, it supports the following networks.

- ethereum
- sepolia
Expand Down Expand Up @@ -211,38 +211,6 @@ async function start() {
start()
```

#### Deploying Standalone Token Registry

This example provides how to deploy TradeTrust standalone token-registry for [transferrable records](https://docs.tradetrust.io/docs/tutorial/transferable-records/overview/). Replace the values for `<your_private_key>` and `<your_provider_url>` with your wallet private key and the JSON RPC url for desired network accordingly. It works on all the [supported networks](https://docs.tradetrust.io/docs/topics/introduction/supported-network/#tradetrust-supported-networks).

```ts
import {
TradeTrustToken__factory,
TOKEN_REG_CONSTS,
} from '@tradetrust-tt/tradetrust-core'
import { Wallet, ethers } from 'ethers'

async function start() {
const unconnectedWallet = new Wallet('<your_private_key>')
const provider = new ethers.providers.JsonRpcProvider('<your_provider_url>')
const wallet = unconnectedWallet.connect(provider)
const tokenFactory = new TradeTrustToken__factory(wallet)
const CHAIN_ID = await wallet.getChainId()
// get the title escrow factory address for each network
const TitleEscrowFactory =
TOKEN_REG_CONSTS.contractAddress.TitleEscrowFactory[CHAIN_ID]
const tokenRegistry = await tokenFactory.deploy(
'DemoTokenRegistry',
'DTR',
TitleEscrowFactory
)
const registryAddress = tokenRegistry.address
// new standalone token registry contract address
console.log(registryAddress)
}
start()
```

#### Wrapping and Minting of Transferrable Record

This example provides how to wrap the [raw transferrable document](https://docs.tradetrust.io/docs/tutorial/transferable-records/raw-document) and mint the tradetrust token for [transferrable record](https://docs.tradetrust.io/docs/tutorial/transferable-records/overview/) using the existing token registry address. Replace the place holders `<your_private_key>`, `<your_provider_url>`, `<token_registry_address>`, `<beneficiary_address>` and `<holder_address>` accordingly. After successfully minted, transaction hash will be displayed and the `wrappedDocument` should be successfully [verified](#verifying).
Expand Down
Loading