Giter Club home page Giter Club logo

contract's Introduction

Starknet.id Contract

This contract is written in Cairo. It allows to mint identity nfts. The nft contains fields associated with values. For each field, there can be a user value or values certified by other contracts. In some cases there can be both.

Official addresses of deployment:

  • Goerli: 0x0798e884450c19e072d6620fefdbeb7387d0453d3fd51d95f5ace1f17633d88b
  • Goerli (old version): 0x04564121a7ad7757c425e4dac1a855998bf186303107d1c28edbf0de420e7023
  • Mainnet: none

Usage

For users

# mint a nft with id token_id (can be random, must not be already minted)
mint(token_id)

# write a data (my discord id) associated to a token_id of a NFT I own and a type (here the felt 'discord')
set_user_data(token_id, 'discord', 707979046952239197)

For verifiers

# confirm this data is correct for this specific type and token_id (e.g. you got a proof)
set_verifier_data(token_id, 'discord', 707979046952239197)

For external services

# get data written by the nft owner
get_user_data(token_id, 'discord')

# get data written by the specified verifier
get_verifier_data(token_id, 'discord', verifier_addr)

# get data only if both verifier and owner agreed on its value
get_confirmed_data(token_id, 'discord', verifier_addr)

Building/testing

Testing: protostar test --cairo-path ./lib/cairo_contracts/src/ BUilding: protostar build --cairo-path ./lib/cairo_contracts/src/

contract's People

Contributors

th0rgal avatar

Stargazers

Sea-Sand-Sunlight 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.