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. Getting Started
  2. Getting set up

Create Smart Contract

The library provides the necessary interface needed to interact with the protocol.

The example code below shows how to create a royalty manager that creates automated compactable Nft royalty sale smart contracts.

pragma solidity ^0.8.7;

import INftRoyaltyFactoryV2 "@picardy-protocol/interface/INftRoyaltyFactoryV2.sol";

///Do not use this code snippet for production as it is just an example 
///and may use hardcoded values.

contract RoyaltyManager {
    
    INftRoyaltyFactoryV2 i_nftRoyaltyFactory;
    
   struct Details {
        uint maxSupply; 
        uint maxMintAmount; 
        uint cost; 
        uint percentage;
        string name;
        string symbol; 
        string initBaseURI;
        string creatorName;
        address creator;
    }  
    
    constructor (address _nftRoyaltyFactory){
        i_nftRoyaltyFactory = INftRoyaltyFactoryV2(_nftROyaltyFactory);
        // You can now use all the functions available in the nftRoyaltyFactory
        // like createNftRoyalty()
    }
    
    function createNftRoyalty(Details calldata _details)external {
        // this function creates the royalty sale contract.
    }
}

Go to Builders Den page to learn more about the interface and all its available methods.

PreviousImport Interface LibraryNextUnderstanding The Protocol

Last updated 2 years ago

๐Ÿ› ๏ธ