🤖Royalty Automation

Picardy royalty contracts have automation ability built in them, this allows easy update of royalty data on-chain using chainlink keepers and chainlink external adapters. The automation is broken into several parts.

External royalty adapter

This contract makes requests to the chainlink node, returns the royalty amount on-chain based on the ticker. It inherits the PayMaster contract interface that acts as a reserve for paying royalties.

RoyaltyAdapterV2

addPicardyReg

This function is called by the Picardy Hub Admin to add the picardyReg address

addValidSaleAddress

this function is called on the registration of automation

this function should only be called by the picardy automation Registrar

checkIsValidSaleAddress

this function is called to check the validity of the royalty sale address

requestRoyaltyAmount

this function is called by a valid royalty sale contract to request the royalty amount to be sent to the paymaster

this function should only be called by a registered royalty sale contract

fulfillrequestRoyaltyAmount

this function is called by the oracle to fulfill the request and send the royalty amount to the paymaster

this function should only be called by the oracle

onTokenTransfer

this is an implimentation of the ERC677 callback function for LINK token

this function should only be called by the LINK token contrac

getRoyaltyLinkBalance

this function gets the link token balance of the royalty sale contract

getPicardyReg

this function is called to get the picardy automation registrar address

contractBalances

getPayMaster

getChainlinkToken

this function is called to withdraw LINK from the contract and should be called only by the picardy hub admin

this function is called by the royalty admin to take out link balance from the contract

this function should only be called by the royalty admin

withdrawBalance

this function is called to withdraw ETH from the contract and should be called only by the picardy hub admin

updateOraclePayment

ths function is called to update the oracle payment and should be called only by the picardy hub admin

cancelRequest

PayMaster

The PayMaster contract acts as a reserve for the royalty payments.

Last updated