Coder Social home page Coder Social logo

masaun / nft-auth-token Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 6.0 184 KB

NFT-based-Auth-Token is the smart contract that NFT is used for the AC (Access Control) management

Solidity 88.71% JavaScript 11.20% Shell 0.09%
solidity truffle web3js mstable ethr-did-registry nft

nft-auth-token's Introduction

NFT based Auth Token


【Introduction of NFT based Auth Token】

  • This is the smart contract that NFT is used for the AC (Access Control) management.

  • NFT Auth Token works as a AC (Access Control) Token.
    • If an user who has a NFT Auth Token, that user can access contents which is permitted. (Admin has tokenID=1 of NFT Auth Token, User has tokenID that is greater than 2 of NFT Auth Token. Depends on tokenID, accessable contents level are different)
    • Login by being verified (checked) whether user has a NFT Auth Token or not.

【Remaining task (Future implementation)】

  • Login
    • When user register, user upload a their profile picture onto IPFS. After that, user get IPFS hash of the uploaded image. That IPFS hash is used as one of condition of login.
    • Also I want to add SSI (Ethr-DID-registry of uPort) verification system for login.

  • Add a pool for staking and earning interest for users (who buy a ticket which NFT Auth Token is embed).
    • I assume that this situation is like a user buy ticket for subscription contents, fun, etc...
    • Utilize mUSD of mStable for depositing into the Pool (earning interst in the Pool / redeeming from Pool, as well)

【Teck Stack】

  • Solidity (solc) v0.6.12
  • Truffle v5.1.49
  • web3.js v1.2.1
  • Node.js v11.15.0

 


【Setup】

  1. Add .env file into the root directory.

  1. Npm install
$ npm install

  1. Migrate
$ npm run migrate:kovan

 

【Script】(on Kovan testnet)

  1. Create a new NFT Auth Token
$ npm run script:NftAuthTokenManager

  1. Mint a new Auth Token ID for user who is called. After that, system check verification whether user who is called has NFT Auth Token (Token ID) or not.
$ npm run script:NftAuthToken

  1. (Future implementaion)
$ npm run script:PoolWithNftAuthToken

 

【Test】

  • Testing for all contract (※ Kovan test network ) <= This test is in progress
$ npm run test:kovan


【References】



nft-auth-token's People

Contributors

masaun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.