Picardy Protocol Docs
  • ๐ŸŽ‰Welcome to Picardy Protocol
  • Overview
    • โœจPicardy Protocol Features
  • Getting Started
    • ๐Ÿ› ๏ธGetting set up
      • Import Interface Library
      • Create Smart Contract
  • Builders Den
    • Understanding The Protocol
    • Artiste / Creators Token Factory
    • Nft Royalty Sale Factory
    • Token Royalty Sale Factory
  • Products
    • NFT Royalty Sale
    • Token Royalty Sale
    • Artiste / creators Token
  • Supported Networks
    • Addresses
  • Automation
    • ๐Ÿค–Royalty Automation
    • ๐ŸงพRegister Automation
    • ๐Ÿ› ๏ธCustom Automation
  • Picardy NFT Domains
    • ๐Ÿ–ผ๏ธPicardy NFT Domains
Powered by GitBook
On this page
  1. Builders Den

Nft Royalty Sale Factory

The Nft Royalty Sale Factory smart contract is a factory contract that allows the creation of NftRoyaltySale contracts. An NftRoyaltySale contract represents a sale of non-fungible tokens (NFTs) with a royalty payment mechanism built in.

The factory contract maintains a mapping of NFT royalty sale contracts, indexed by the artist's name and the NFT name, as well as a mapping of NFT royalty details, indexed by the contract's address. It also maintains a struct called RoyaltyDetails, which holds the percentage of royalties to be paid and the address of the party receiving the royalties.

NftRoyaltySaleFactoryV2

Details

struct Details {
  uint256 maxSupply;
  uint256 maxMintAmount;
  uint256 cost;
  uint256 percentage;
  string name;
  string symbol;
  string initBaseURI;
  string creatorName;
  address creator;
}

NftRoyaltyDetails

struct NftRoyaltyDetails {
  uint256 royaltyId;
  uint256 royaltyPercentage;
  string royaltyName;
  address royaltyAddress;
}

RoyaltyDetails

struct RoyaltyDetails {
  uint256 royaltyPercentage;
  address royaltyAddress;
}

createNftRoyalty

function createNftRoyalty(struct NftRoyaltySaleFactoryV2.Details details) external returns (address)

Creates a new NftRoyaltySale contract

The NftRoyaltySale contract is created using the Clones library

Parameters

Name
Type
Description

details

struct NftRoyaltySaleFactoryV2.Details

Return Values

Name
Type
Description

[0]

address

Address of the newly created NftRoyaltySale contract

updateRoyaltyDetails

function updateRoyaltyDetails(uint256 _royaltyPercentage) external

Updates the royalty details

Only the Picardy Hub Admin can call this function. Do not confuse this with the royalty percentage for the NftRoyaltySale contract

Parameters

Name
Type
Description

_royaltyPercentage

uint256

getLinkToken

function getLinkToken() external view returns (address)

getRoyaltyDetails

function getRoyaltyDetails() external view returns (address, uint256)

getHubAddress

function getHubAddress() external view returns (address)

getNftRoyaltySaleAddress

function getNftRoyaltySaleAddress(string _creatorName, string _name) external view returns (address)
PreviousArtiste / Creators Token FactoryNextToken Royalty Sale Factory

Last updated 2 years ago