Third-Party Solutions
Developers may choose their preferred third-party solutions for token pricing. In order for these to be able to communicate properly with the protocol, they simply have to deploy an adapter contract -if necessary- that implements the protocol interface for the respective kind of token.
This way, the adapter contract will live in the middle of the application and the external pricer contract in order to format the request and response between these two elements:
The functions that these adapters must implement are:
ERC721 Pricing Functions
For the full interface, see IProtocolERC721Pricing.
ERC20 Pricing Functions
For the full interface, see IProtocolERC20Pricing.
Developers may choose to implement and deploy an adapter contract per token standard (one for ERC20 and another for ERC721), or to implement both in a single contract to deploy. No matter the route taken, the appManager Handler must have both pricer addresses set in order to properly work.
Upgrading:
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 setERC20Pricing
from the Application Handler contract.
The set functions requires the caller to be a rule administrator. Each pricing contract must conform to the IProtocolERC20Pricing.