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

Token Royalty Sale Factory

The TokenRoyaltySaleFactory smart contract is a factory contract that allows the creation of TokenRoyaltySale contracts. A TokenRoyaltySale contract is a contract that allows the sale of royalties as an ERC20 token.

The factory contract maintains a mapping of TokenRoyaltySale contracts, indexed by the token royalty ID, as well as a mapping of TokenRoyaltyDetails, which holds details about the TokenRoyaltySale contracts. 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.

TokenRoyaltySaleFactoryV2

TokenRoyaltyDetails

struct TokenRoyaltyDetails {
  uint256 tokenRoyaltyId;
  uint256 askAmount;
  uint256 returnPercentage;
  address tokenRoyaltyAddress;
}

RoyaltyDetails

struct RoyaltyDetails {
  uint256 royaltyPercentage;
  address royaltyAddress;
}

createTokenRoyalty

function createTokenRoyalty(uint256 _askAmount, uint256 _returnPercentage, string creatorName, string name, address creator) external returns (address)

Creats A ERC20 token royalty sale. contract is created using the Clones library

Parameters

Name
Type
Description

_askAmount

uint256

The total askinng amount for royalty

_returnPercentage

uint256

Percentage of royalty to sell

creatorName

string

name

string

creator

address

updateRoyaltyDetails

function updateRoyaltyDetails(uint256 _royaltyPercentage) external

the function is used to update the royalty percentage.

only hub admin can call this function

Parameters

Name
Type
Description

_royaltyPercentage

uint256

the amount in percentage the hub takes.

getRoyaltyDetails

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

getTokenRoyaltyAddress

function getTokenRoyaltyAddress(string creatorName, string name) external view returns (address)

getRoyaltySaleDetails

function getRoyaltySaleDetails(address _royaltySaleAddress) external view returns (struct TokenRoyaltySaleFactoryV2.TokenRoyaltyDetails)

getHubAddress

function getHubAddress() external view returns (address)

getLinkToken

function getLinkToken() external view returns (address)
PreviousNft Royalty Sale FactoryNextNFT Royalty Sale

Last updated 2 years ago