Skip to content

SparkNFT/SparkLinkSmartContract

Repository files navigation

SparkLink Smart Contract

Brief introduction

SparkLink Smart Contract is an Ethereum smart contract.

Authors can publish their virtual products (such as a book) on the blockchain and generate a root NFT.

Others can buy a child NFT3 from any existing father NFT2, holder of NFT2 will get income.

At the same time, holders of NFT2's father NFT3 will extract the amount corresponding to the proportion of royalties from the profit of the child NFT2.

SparkLink Smart Contract can support these features:

  • Authors can create virtual products (such as a book) with attributes (such as: royalty percent, maximum number of child NFTs).
  • Accept shill from an existing NFT and will get an child NFT.
  • Claim the profit generated by the NFT you own.

For design details, please see API document.

Getting Started

To install required node.js modules:

npm ci

To compile the solidity source code

make build

To run unit test:

make test

To deploy the smart contract on Ethereum rinkeby testnet:

make rinkeby

To build a docker image for test usage:

npm run build:image

Note:

  • This project is powered by hardhat. You can change your network configuration in hardhat.config.ts file.

  • Before you deploy a smart contract or interact with a smart contract, you need to set up your wallet private key and infura key in config.json.

    config.json is a template, which contains dummy configurations.

    Please handle your private key carefully. In this project, config.json has already been added into .gitignore, as foolproof.

Deployed Contract Address

Contract Address
Polygon 0xb83A6A35
Rinkeby 0x71872117

Contribute

Any contribution is welcomed to make it better.

Had you any questions, please do not hesitate to create an issue.

License

MIT LICENSE

About

Smart contract of SparkLink Dapp.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6