Giter VIP home page Giter VIP logo

dimo-identity's Introduction

DIMO Identity

Documentation

How to run

You can execute the following commands to build the project and run additional scripts:

# Installs dependencies
npm i

# Clears cache, compiles contracts, generates typechain files and NFT ABIs
npm run build

# Outputs contract sizes
npm run contract-sizer

# Commands to check and fix linting errors in typescript and solidity files
npm run lint
npm run lint:ts
npm run lint:ts:fix
npm run lint:sol
npm run lint:sol:fix

You can deploy the whole system running the following script, where network_name is one of the networks available in hardhat.config.ts. Deployed contract addresses will be written in scripts/data/addresses.json:

npx hardhat run scripts/deploy.ts --network '<network_name>'

You can more easily add/remove/update modules and update NFTs using the following script. Just make sure to update the main function accordingly:

npx hardhat run scripts/deployModule.ts --network '<network_name>'

You can also verify contracts in etherscan/polygonscan/etc running the following command. Remove <constructor_arguments> if there isn't any.

npx hardhat verify '<deployed_contract_address>' '<constructor_arguments>' --network '<network_name>'

# Use this flag to specify the contract implementation if needed
npx hardhat verify '<deployed_contract_address>' '<constructor_arguments>' --network '<network_name>' --contract '<contract_path>:<contract_name>'

Testing

The test suite is organized in different files according to the contract name <ContractName>.test.ts. Each file groups the tests by function name, covering, respectively, reverts, state modification and events. You can run the test suite with the following commands:

# Runs test suite
npm run test

# Runs solidity coverage
npm run coverage

ABI generator

The DIMO identity architecture uses the DIMORegistry contract as an entry point to any module of the system. To interact with DIMO identity, then, a massive ABI containing all available functions is needed. You can generated this ABI running the follwing command:

npx hardhat run scripts/abiGenerator.ts

The output file will be saved in ./abis/DimoRegistry.json.

Go ABI

To regenerate the Go bindings for, e.g., the devices API, you would run

abigen --abi abis/DimoRegistry.json --out registry.go --pkg contracts --type Registry

and copy over that file.

dimo-identity's People

Contributors

lorransutter avatar zer0stars avatar elffjs 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.