Git Source

Inherits: Ownable, IApplicationEvents, IProtocolERC721Pricing

Author: @ShaneDuncan602, @oscarsernarosero, @TJ-Everett

This contract is a simple pricing mechanism only. Its main purpose is to store prices.

This contract allows for setting prices on entire collections or by tokenId

State Variables

VERSION

string private constant VERSION = "2.1.0";

nftPrice

mapping(address => mapping(uint256 => uint256)) public nftPrice;

collectionPrice

mapping(address => uint256) public collectionPrice;

Functions

setSingleNFTPrice

set the price for a single NFT from a collection

function setSingleNFTPrice(address nftContract, uint256 id, uint256 price) external onlyOwner;

Parameters

NameTypeDescription
nftContractaddressis the address of the NFT contract
iduint256of the NFT
priceuint256price of the Token in weis of dollars. 10^18 => $ 1.00 USD 999_999_999_999_999_999 = 0xDE0B6B3A763FFFF, 1_000_000_000_000_000_000 = DE0B6B3A7640000

setNFTCollectionPrice

set the price for whole collection. If an NFT has a price specific for it, the collection price would have the second priority.

function setNFTCollectionPrice(address nftContract, uint256 price) external onlyOwner;

Parameters

NameTypeDescription
nftContractaddressis the address of the NFT contract
priceuint256price of the Token in weis of dollars. 10^18 => $ 1.00 USD 999_999_999_999_999_999 = 0xDE0B6B3A763FFFF, 1_000_000_000_000_000_000 = DE0B6B3A7640000

getNFTPrice

gets the price of an NFT. It will return the NFT’s specific price, or the price of the collection if no specific price has been given

function getNFTPrice(address nftContract, uint256 id) external view returns (uint256 price);

Parameters

NameTypeDescription
nftContractaddressis the address of the NFT contract
iduint256of the NFT

Returns

NameTypeDescription
priceuint256of the Token in weis of dollars. 10^18 => $ 1.00 USD 999_999_999_999_999_999 = 0xDE0B6B3A763FFFF, 1_000_000_000_000_000_000 = DE0B6B3A7640000

getNFTCollectionPrice

gets the price of an NFT Collection. It will return the NFT Collection price to be used for each token Id (i.e. Floor Price).

function getNFTCollectionPrice(address nftContract) external view returns (uint256 price);

Parameters

NameTypeDescription
nftContractaddressis the address of the NFT contract

Returns

NameTypeDescription
priceuint256for the collection in weis of dollars. 10^18 => $ 1.00 USD 999_999_999_999_999_999 = 0xDE0B6B3A763FFFF, 1_000_000_000_000_000_000 = DE0B6B3A7640000

version

gets the version of the contract

function version() external pure returns (string memory);

Returns

NameTypeDescription
<none>stringVERSION