This repository contains the smart contracts for the Nuklai protocol.
The protocol empowers Dataset owners to seamlessly integrate, configure, and maintain their Datasets on-chain. It achieves this by issuing ERC721 tokens, each serving as a unique digital representation of a Dataset. These tokens not only signify ownership but also act as a gateway for contributors.
In addition, the protocol serves as a marketplace, enabling data providers (owners of datasets) to publish and monetize their data through subscriptions from consumers. It goes beyond data management and allows users to actively contribute to these datasets.
Contributions are recorded on-chain as distinct ERC721 tokens called fragments, each representing a valuable addition to a Dataset. Contributors can be rewarded with revenue for their valuable contributions, fostering collaboration and innovation within the ecosystem. This multifaceted approach transforms data management into a dynamic and inclusive process, benefitting all participants.
To install all the dependencies of this repo, execute the following command:
yarn
or
yarn install
To compile contracts, export ABIs, and generate TypeScript interfaces, execute the following command:
yarn build
To remove cached and temporary files, execute the following command:
yarn clean
To run all unit tests, execute the following command:
yarn test
To generate a coverage report, execute the following command:
yarn coverage
To generate a contracts size report, execute the following command:
yarn contract-size
To run linting on all configured source files (*.sol
, *.ts
, *.js
, *.json
), execute the following command:
yarn lint
- Fork it or Clone it
- Create your feature or fix branch (
git checkout -b feature/foo
) - Commit your changes (
git commit -am 'add something'
) - Push the branch (
git push origin feature/foo
) - Create a new Pull Request
Smart Contract | Description |
---|---|
DatasetFactory |
Facilitates the streamlined integration and configuration of Datasets in the Nuklai protocol, in a single transaction. Each Dataset integration results in the minting of an ERC721 token (Dataset NFT) which is transferred to the respective Dataset owner |
DatasetNFT |
The protocol's core extends ERC721 to mint tokens representing unique datasets, enabling dataset configuration, and maintaining a record of these configurations |
FragmentNFT |
An ERC721 extension where each token represents an incorporated contribution to a specific dataset. Contribution types are encoded as tags which are linked to the respective token |
DistributionManager |
Manages the distribution of fees to dataset owners and contributors. It provides configuration options for fee distribution percentages among parties |
GenericSingleDatasetSubscriptionManager |
An abstract contract serving as the foundation for managing single dataset subscriptions and related operations |
ERC20SubscriptionManager |
Extends the abstract GenericSingleDatasetSubscriptionManager contract to handle dataset subscriptions using ERC20 or native tokens as payment |
VerifierManager |
Configures and coordinates verifiers for datasets' proposed contributions, handling approval or rejection operations based on the configured verifiers |
AcceptManuallyVerifier |
Verifier that provides the resolution mechanisms for the Dataset owner to either accept or reject proposed contributions manually |
AcceptAllVerifier |
Verifier that automatically accepts all proposed contributions by default |