This is a protocol template for an ERC721-pricing contract. Any custom-made pricing contract that intends to be protocol compliant must implement the IProtocolERC721Pricing interface, and follow the price format guideline.This template is available for developers to quickly get their pricing modules up and running.ERC721 Pricing structure requires that ERC721 contracts support ERC165 interface.
This function should be used in the case of specifying the price for a particular NFT in a collection. This price will prevail over the collection price if any:
This function should be used to set the default price for every NFT in a collection. This price should be used as the floor price since the collection price is always overriden by specific NFT price. In other words, the price for an NFT is only going to be the collection price if the NFT doesn’t have a particular price set for it.
There are certain rules in the protocol which assess cumulative account balances based on ERC20 and ERC721 ownership and valuations. It is possible that an account might own many thousands of NFT’s which could cause an “out of gas” error while processing. To mitigate this possible issue, ProtocolERC721Handler contains a variable, nftValuationLimit, which is defaulted to 100. This means that any account that owns more than 100 different NFT’s will use the NFT Collection price for each type of NFT collection owned as opposed to getting the unique price per tokenId. This reduces gas impacts for the balance based rule checks. This variable may be set to suit the specific needs of each application and/or token and may only be set by an Application Administrator.
To upgrade the pricing contract, ensure your new pricing contract is deployed to the same network your Application Handler is deployed to. Next, you will call the function setNFTPricing from the Application Handler contract.
Copy
Ask AI
function setNFTPricingAddress(address _address) external ruleAdministratorOnly(appManagerAddress)