NFT Royalty Sale
Nft Royalty Sale is a contract for selling royalty NFTs (non-fungible tokens). It is a contract that manages the sale of royalty NFTs, which represent a percentage of future sales of a particular product or asset. It provides functions for creating and managing the sale of royalty NFTs, including functions for setting the price and percentage of royalties, as well as functions for buying and selling royalty NFTs. The contract also includes functionality for automating the sale of royalties, using the Chainlink network to retrieve real-time data on the sales of the underlying product or asset.
The contract contains several structs and mappings to store data about the royalty NFTs and their sales. The Royalty struct stores information about a particular royalty NFT, including the maximum number of NFTs that can be sold, the price of each NFT, the percentage of royalties represented by each NFT, and the artist's name and product name. The contract also includes mappings to track the balance of royalty NFTs for each address, as well as a mapping to track which NFTs are owned by each address.
NftRoyaltySaleV2
Royalty
NodeDetails
initialize
start
this function is called by the contract owner to start the royalty sale
this function can only be called once and it cretes the NFT contract
setupAutomationV2
this function is called by Picardy Royalty Registrar when registering automation and sets up the automation
This function is called by picardy royalty registrar, PS: royalty adapter contract needs LINK for automation to work
Parameters
_updateInterval
uint256
update interval for the automation
_royaltyAdapter
address
address of Picardy Royalty Adapter
_oracle
address
address of the oracle
_jobId
string
job id for the oracle
toggleAutomation
this function is called by the contract owner to pause automation
this function can only be called by the contract owner and picardy royalty registrar
checkUpkeep
This function is used by chainlink keepers to check if the requirements for upkeep are met
this function can only be called by chainlink keepers
performUpkeep
This function is used by chainlink keepers to perform upkeep if checkUpkeep() returns true
this function can be called by anyone. checkUpkeep() parameters again to avoid unautorized call.
buyRoyalty
This function can be called by anyone and is a payable function to buy royalty token in ETH
Parameters
_mintAmount
uint256
amount of royalty token to be minted
_holder
address
address of the royalty token holder
updateRoyalty
This function can only be called by the royaltySale owner or payMaster contract to pay royalty in ERC20. this function can only be called by the contract owner or payMaster contract
Parameters
_amount
uint256
amount of ERC20 tokens to be paid back to royalty holders
tokenAddress
address
address of the ERC20 token
getUpdateRoyaltyCaller
helper function that makes sure the caller is the owner or payMaster contract
toggleRoyaltySale
This function changes the state of the royalty sale and should only be called by the owner
pauseTokenBase
his function is used to pause the ERC721 token base contract
this function can only be called by the contract owner
unPauseTokenBase
his function is used to unPause the ERC721 token base contract
this function can only be called by the contract owner
getTimeLeft
withdraw
This function is used to withdraw the funds from the royalty sale contract and should only be called by the owner
withdrawRoyalty
This function is used to withdraw the royalty. It can only be called by the royalty token holder
Parameters
_amount
uint256
amount of royalty token to be withdrawn
_holder
address
address of the royalty token holder
withdrawERC20Royalty
This function is used to withdraw the royalty in ERC20. It can only be called by the royalty token holder
Parameters
_amount
uint256
amount of royalty token to be withdrawn
_holder
address
address of the royalty token holder
_tokenAddress
address
changeUpdateInterval
This function is uded to change the update interval of the royalty automation
Parameters
_updateInterval
uint256
new update interval
pause
This function is used to pause the royalty sale contract and should only be called by the owner
unpause
This function is used to unpause the royalty sale contract and should only be called by the owner
transferOwnership
this function is used to transfer ownership of the sale contract to a new owner and should only be called by the owner
updateNodeDetails
This function is used to change the oracle address and jobId of the chainlink node for custom job id
this function can only be called by the contract owner. (See docs for custom automation)
Parameters
_oracle
address
new oracle address
_jobId
string
new jobId
getTokensId
getERC20RoyaltyBalance
getTokenDetails
getCreator
getRoyaltyTokenAddress
getOwner
getRoyaltyPercentage
_getTokenIds
checkAutomation
Last updated