Deploy a Semantic SBT contract leveraging Relation Protocol

We can use the contract template provided by Relation protocol to deploy our own Semantic SBT contracts.

Hardhat is used as the deployment tool. You can refer to: Use Hardhat to deploy contracts

  1. Download the contract

git clone git@github.com:relationlabs/semanticSBT.git
  1. Install dependencies

cd semanticSBT
npm install
  1. Modify the configuration file

vi hardhat.config.js

Comment the following code segment so that it will not be executed.( For now we only use a local network to demonstrate contract deployment. We don't need to configure other networks.)

rinkeby: {
  url: `https://rinkeby.infura.io/v3/${INFURA_PROJECT_ID}`,
  accounts: [`${PRIVATE_KEY}`]
}
  1. Compile the code

npx hardhat node &
npx hardhat compile
  1. Modify the parameters for contract initialization

Use an editor to open the deployment script.

Modify the parameters

  • name: The name of the contract

  • symbol: The symbol of the contract

  • baseURI: The root directory of the tokenURI of the contract

  1. Execute the deployment script

A successful deployment will show the below message in the console:

The last line of output is an RDF data representing the relationship of one address following another:

Last updated