GithubHelp home page GithubHelp logo

kralonur / solidity_document_verification Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 1.72 MB

Contracts for verifying document on blockchain

Shell 0.91% JavaScript 0.30% TypeScript 62.61% Solidity 36.18%
document hardhat keccak256 solidity typescript

solidity_document_verification's Introduction

Document Verification Using Solidity

This project allows verifying documents using their hashes. So as an example documents hash could be generated using keccak256 then this hash would be add to contract and signed by requested addresses.

NOTES

Contracts are put on verification only by document creators. Document creators allowance set on Management contracts. ManagementSingle contract only for managing single DocumentVerification contract. ManagementMulti contract for managing multi DocumentVerification contracts. For managing multiple different DocumentVerification contracts controllers are used in ManagementMulti contract, each controller can only control 1 DocumentVerification contract

Installation

Pre Requisites

Before running any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment variable. Follow the example in .env.example. If you don't already have a mnemonic, use this website to generate one.

  1. Install node and npm
  2. Install yarn
npm install --global yarn

Check that Yarn is installed by running:

yarn --version

Then, proceed with installing dependencies:

yarn install

Usage/Examples

Compile

Compile the smart contracts with Hardhat:

yarn compile

TypeChain

Compile the smart contracts and generate TypeChain artifacts:

yarn typechain

Lint Solidity and TypeScript

Lint the Solidity and TypeScript code (then check with prettier):

yarn lint

Clean

Delete the smart contract artifacts, the coverage reports and the Hardhat cache:

yarn clean

Docs

Create documentation for the contracts (in "docs" folder):

yarn docgen

Available Tasks

To see available tasks from Hardhat:

npx hardhat

Running Tests

Test

To run tests, run the following command:

yarn test

Test with gas reportage

To report gas after test, set REPORT_GAS="true" on .env file. Then run test.

Coverage

Generate the code coverage report:

yarn coverage

Deployment

Deployment

To deploy this project first change those fields on your .env file:

MNEMONIC="your mnemomic" that should be your REAL mnemonic that you use on chain.

RUN_OPTIMIZER="true" that is recommended for gas fees optimization.

Then set your infura or alchemy api key (depending on chain you want to deploy).

Deployment arguments

You have to create deploy argument json file, using examples on deployargs folder. So first create a json file using example: deploy${ContractName}Args.example.json file, new json file should be exact same name but without .example in it's file name. Example: deploy${ContractName}Args.json, then fill the fields.

Deployment commands

yarn deploy:${contractname} --network ${networkToDeploy}

Example:

yarn deploy:token --network rinkeby

Verification

To verify the contract first change block explorer api key on your .env file, depending on your network. For example, for ethereum network: ETHERSCAN_API_KEY="etherscan_api_key".

Verification commands

yarn verify:${contractname} --address ${deployed_contract_address} --network ${network}

Example:

yarn verify:token --address ${deployed_contract_address} --network rinkeby

Contributing

For git linting commitlint is being used. This website can be helpful to write commit messages.

solidity_document_verification's People

Contributors

kralonur avatar

Watchers

 avatar

Forkers

cryptobuks

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.