Skip to content

relationlabs/semanticSBT

 
 

Repository files navigation

Semantic Soulbound Token

Setup

Clone the Repository

git clone [email protected]:JessicaChg/semanticSBT.git
cd semanticSBT

Set environment

# require Node.js 14+
cp .env.example .env
# modify the env variable `*_PrivateKey` to your own private key

Use brownie

compile the contracts

  • install the library of this project depends on
pip3 install eth-brownie
  • compile contracts
brownie compile
  • test contracts
brownie test

deploy

  1. deploy to testnet, take the goerli as example
  • add or modify network
brownie networks list
brownie networks add Ethereum goerli host=<RPC_URL> chainid=5 explorer=<EXPORE_URL>
# update networks
brownie networks modify   goerli  host=<NEW_RPC_URL> chainid=5 explorer=<NEW_EXPORE_URL>
  • set network_to_cid
cp metadata/network_to_cid.json.sample metadata/network_to_cid.json
  • deploy
# libraries
brownie run brownie_scripts/libraries/deploy_semanticUpgradeLogic.py --network goerli
brownie run brownie_scripts/libraries/deploy_nameserviceLogic.py  --network goerli 
brownie run brownie_scripts/libraries/deploy_daoregisterLogic.py  --network goerli 
brownie run brownie_scripts/libraries/deploy_followregisterLogic.py  --network goerli 

# upgradeable
brownie run brownie_scripts/upgrade/deploy_proxyadmin.py --network goerli

# social
brownie run brownie_scripts/social/deploy_nameservice.py  --network goerli 
brownie run brownie_scripts/social/deploy_dao_register.py  --network goerli 
brownie run brownie_scripts/social/deploy_follow_register.py  --network goerli 
brownie run brownie_scripts/social/deploy_content.py  --network goerli 

# relation
brownie run brownie_scripts/relation/deploy_relation_profile_nft.py  --network goerli 
brownie run brownie_scripts/relation/deploy_relation_withdraw.py --network goerli

use hardhat

compile the contracts

  • install the library of this project depends on
npm install
  • compile contracts
npx hardhat compile
  • test contracts
npx hardhat test

deploy

  1. fill in the parameters in hardhat.config.js
// Replace "INFURA PROJECT ID" with your INFURA project id
// Go to https://infura.io/, sign up, create a new App in its dashboard, and replace "KEY" with its key
const INFURA_PROJECT_ID = "INFURA INFURA PROJECT ID";

// Replace "PRIVATE KEY" with your account private key
// To export your private key from Metamask, open Metamask and go to Account Details > Export Private Key
// Be aware of NEVER putting real Ether into testing accounts
const PRIVATE_KEY = "PRIVATE KEY";
  1. deploy to local
npx hardhat node
npx hardhat run scripts/deploy.js
  1. deploy to testnet, take the goerli as example
  • deploy and verify
npx hardhat run scripts/deploy.js --network goerli

npx hardhat verify --contract contracts/core/Semantic.sol:Semantic  --network goerli <DEPLOYED_CONTRACT_ADDRESS>

Overview

The Contract Open Standard is a smart contract specification defined by the Relation Protocol. It has two basic requirements:

  • The contracts should conform to the data format and interface specification defined by the Open Standard API.
  • The RDF data constructed by these contracts should conform to the Schema Standard.

Relation Protocol defined a set of Base Contracts based on the Contract Open Standard to address the three following scenarios.

Identity: Describe users' identity via SBT contracts.

Relationships: Describe connections between different users via SBT contracts.

Publication: Describe users' public or privacy content published via SBT contracts.

Base Contracts

Base Contracts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 48.7%
  • Solidity 43.9%
  • Python 7.3%
  • TypeScript 0.1%