0.0.7 • Published 11 months ago

@fluencr/fluencr-protocol v0.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Fluencr protocol

This package allows web3 projects to sell their NFTs through the Fluencr affiliate marketplace.

:warning: Projects need to be whitelisted in order to make their NFTs available through the platform. Visit https://fluencr.xyz to learn more. :warning:

Usage

Inherit Fluencr in your contract.

Managing NFTs available for sale

  • Make sure your NFTs conform to the Product struct in IFluencr.
  • If you support multiple NFTs through your contract, either through multiple collections or ERC1155 you need to add the NFTs you want to list for sale in a Product[] storage.
  • :information_source: If you only support one NFT within your contract you can do not need to save the state of the products in a separate storage.
  • Implement the listProducts() functions so that it returns the Product[] memory for the NFTs you would like to list for sale.

That´s it. Your NFTs will now be listed on the Fluencr platform.

Managing the actual sale

Upon a sale the following functions needs to be implemented.

  • getPrice(uint256 id) will need to return the price for the specific Product associated with that id.
  • :information_source: (Again) if you don't support sale of multiple NFTs from the same contract you would just return the price of your NFT and ignore the id input (however, it has to be included in the function parameter).
  • Override the _sell(address buyer, uint256 id) to manage the sale of your NFT. id is used to identify the NFT associated with that id. Ignore this if you only allow sale of one NFT from your contract. buyer is the receiver of the NFT.

:warning: You are free to implement this so it conforms with your contract. It can either be a fress _mint() or a secondary sale. The important thing is that the buyer receives the associated NFTs as balance validation checks will follow :warning:

0.0.7

11 months ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago