CaviarEthRoyaltyRouter.sol

Git Source

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.

IRoyaltyRegistry public royaltyRegistry;

Functions

constructor

constructor(address _royaltyRegistry) Owned(msg.sender);

receive

receive() external payable;

setRoyaltyRegistry

Set the royalty registry.

function setRoyaltyRegistry(address _royaltyRegistry) public onlyOwner;

Parameters

nftBuy

Make a buy and pay royalties.

function nftBuy(address pair, uint256[] calldata tokenIds, uint256 maxInputAmount, uint256 deadline)
    public
    payable
    returns (uint256 inputAmount);

Parameters

Returns

nftSell

Sell NFTs and pay royalties.

function nftSell(
    address pair,
    uint256[] calldata tokenIds,
    uint256 minOutputAmount,
    uint256 deadline,
    bytes32[][] calldata proofs,
    ReservoirOracle.Message[] calldata messages
) public returns (uint256 outputAmount);

Parameters

Returns

getRoyaltyRate

Get the royalty rate with 18 decimals of precision for a specific NFT collection.

function getRoyaltyRate(address tokenAddress) public view returns (uint256);

Parameters

_approve

Approves the pair for transfering NFTs from this contract.

function _approve(address tokenAddress, address pair) internal;

Parameters

_payRoyalties

Pay royalties for a list of NFTs at a specified price for each NFT.

function _payRoyalties(address tokenAddress, uint256[] calldata tokenIds, uint256 salePrice)
    internal
    returns (uint256 totalRoyaltyAmount);

Parameters

Returns

_getRoyalty

Get the royalty for a specific NFT.

function _getRoyalty(address lookupAddress, uint256 tokenId, uint256 salePrice)
    internal
    view
    returns (address recipient, uint256 royaltyAmount);

Parameters

Last updated