Skip to content

DataNexusMarket/DataNexusContracts

Repository files navigation

DataNexus Contracts

DataNexus is a decentralized, peer-to-peer market that enables average, everyday people to control their data. Businesses are able to securely purchase personal data generated from web APIs. Using Chainlink functions along with a streamlined encryption scheme, user secrets and personal data are never revealed publicly. The data is only revealed to the purchaser upon transfer of funds.

Prerequisites

  1. Install Deno
  2. Install yarn

Installing

  1. Install dependencies:
yarn install
  1. Compile Contracts:
yarn hardhat compile

Testing

Configure .env

To run the following tests, you have to have a .env file configured. Copy the .env.example and fill in the require environemnt variables.

  1. You can create RPC URL using Alchemy or Chainlist for testnet.
  2. Get your private key from Metamask ** MAKE SURE YOU'RE USING A TEST ACOCUNT WITH NO REAL FUNDS **
  3. Get Coinmarketcap API Key
  4. Follow the instructions here to generate a Github API token
  5. Use the Google OAuth 2.0 Playground to generate a temporary access token (these only last an hour).
  6. Get a NFT.storage API Key

Frontend Integration

  1. Clone frontend repo in the same root directory
git clone https://github.com/DataMineMarket/Frontend.git
  1. Set UPDATE_FRONT_END=true in .env
  2. Now, upon deployment, the frontend will be updated with the relevant contract addresses and ABIs.

Local Tests

The local tests use Chainlink's functions toolkit to simulate functions executions localy.

  1. Create a file test/helper/secrets.json, this will be populated with a local private key after running the test command below.
  2. Run yarn hardhat test to run the local tests

Staging Tests

This test will run on mumbai testnet, and will use real testnet funds.

Prerequisite: Get USDC from the AAVE Faucet. You will need to enable testnet mode at the top right.

  1. Run yarn hardhat deploy --network mumbai
  2. The deploy script will automatically update your subscription with a newly created consumer.
    • Make sure your subscription Id is configured in functionsSubscriptionId in helper-hardhat-config.ts
  3. Run yarn hardhat test --network mumbai

About

A repo for the contracts of DataMine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published