Coder Social home page Coder Social logo

chiptable's Introduction

ChipTable

This is an on-chain interim solution to ERS. It will provide a simple chip lookup table for vendors.

Design

Owner

Privileges:

  • Can register TSMs
  • Can add chipIds without needing signature

Data:

  • address

TSM

Privileges:

  • Can add chips with signature
  • Can approve an operator to add chips for TSM

Data:

  • tsmId: hash of the name (keccak(name))
  • address: address that owns tsm
  • operator: approved operator for tsm
  • name: name of the tsm
  • uri: redirect uri of the tsm

Chip

Data:

  • tsmId: maps the chip to a tsm

Scripts

Deploy

Deploy chipTable.sol. Requires owner, version and network parameters.

Usage

node scripts/deploy-script.js -o OWNER_ADDRESS -v VERSION -n NETWORK

Register TSM

Add a new TSM. Can only be called by owner. Requires contract-address, tsm, uri and network parameters.

Usage

node scripts/register-tsm.js -c CHIP_TABLE_ADDRESS -t TSM_ADDRESS -u TSM_URI -n NETWORK

Register Chips

Add chips to chipTable. Expects a .txt file with one chip public key, 04 prepended, per line. See publicKeySamples.txt. Requires contract-address, tsm, public-key-path and network parameters.

Usage

node scripts/register-chips.js -c CHIP_TABLE_ADDRESS -t TSM_ADDRESS -p PUBLIC_KEY_LIST_FILE -n NETWORK

.env

  • PRIVATE_KEY="<your_private_key>": Used for deploying
  • ALCHEMY_API_KEY="<your_alchemy_api_key>": Used for forking mainnet
  • COINMARKETCAP_KEY="<your_coinmarketcap_key>": Used for tracking gas prices
  • ETHERSCAN_API_KEY="<your_etherscan_key>": Used for verifying contracts on Etherscan

chiptable's People

Contributors

ccamrobertson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.