CaviarEthRoyaltyRouter.sol
Inherits: Owned, ERC721TokenReceiver
Author: out.eth
This contract is used to swap NFTs and pay royalties.
State Variables
royaltyRegistry
The royalty registry from manifold.xyz.
Functions
constructor
receive
setRoyaltyRegistry
Set the royalty registry.
Parameters
_royaltyRegistry
address
The new royalty registry.
nftBuy
Make a buy and pay royalties.
Parameters
pair
address
The pair address.
tokenIds
uint256[]
The tokenIds to buy.
maxInputAmount
uint256
The maximum amount of ETH to spend.
deadline
uint256
The deadline for the swap.
Returns
inputAmount
uint256
The amount of ETH spent.
nftSell
Sell NFTs and pay royalties.
Parameters
pair
address
The pair address.
tokenIds
uint256[]
The tokenIds to sell.
minOutputAmount
uint256
The minimum amount of ETH to receive.
deadline
uint256
The deadline for the swap.
proofs
bytes32[][]
The proofs for the NFTs.
messages
Message.ReservoirOracle[]
Returns
outputAmount
uint256
The amount of ETH received.
getRoyaltyRate
Get the royalty rate with 18 decimals of precision for a specific NFT collection.
Parameters
tokenAddress
address
The NFT address.
_approve
Approves the pair for transfering NFTs from this contract.
Parameters
tokenAddress
address
The NFT address.
pair
address
The pair address.
_payRoyalties
Pay royalties for a list of NFTs at a specified price for each NFT.
Parameters
tokenAddress
address
The NFT address.
tokenIds
uint256[]
The tokenIds to pay royalties for.
salePrice
uint256
The sale price for each NFT.
Returns
totalRoyaltyAmount
uint256
The total amount of royalties paid.
_getRoyalty
Get the royalty for a specific NFT.
Parameters
lookupAddress
address
The lookup address for the NFT royalty info.
tokenId
uint256
The tokenId to get the royalty for.
salePrice
uint256
The sale price for the NFT.
Last updated