Royalties


Royalties for a token can be retrieved using getRoyalties function in both (PNDC_ERC721 and TokenERC721) contracts.

    getRoyalties(
        uint256 _tokenId
    )

It returns an array of Share struct.


In the TokenERC721 contract, there are additional functions for setting Royalties by token Id and for collections.

By TokenId-

    setRoyaltiesByTokenId(
        uint256 _tokenId,
        RoyaltiesSet memory royaltiesSet
    )
  • _tokenId: Id of token whose royalty is getting set
  • royaltiesSet: RoyaltiesSet struct

It emits an event:

RoyaltiesSetForTokenId(_tokenId, royaltiesSet.royalties);

For Collections-

    setRoyaltiesForCollection(
        LibShare.Share[] memory royalties
    )
  • royalties: array of Share struct

It emits an event:

RoyaltiesSetForCollection(royalties);