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.
To install required node.js modules:
npm ciTo compile the solidity source code
make buildTo run unit test:
make testTo deploy the smart contract on Ethereum rinkeby testnet:
make rinkebyTo 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.tsfile. -
Before you deploy a smart contract or interact with a smart contract, you need to set up your wallet private key and
infurakey inconfig.json.config.jsonis a template, which contains dummy configurations.Please handle your private key carefully. In this project,
config.jsonhas already been added into.gitignore, as foolproof.
| Contract | Address |
|---|---|
| Polygon | 0xb83A6A35 |
| Rinkeby | 0x71872117 |
Any contribution is welcomed to make it better.
Had you any questions, please do not hesitate to create an issue.