Pricing Module Deployment
In order for US-Dollar-based application rules to function properly, the protocol needs to be able to determine the price of each asset. There are two ways to accomplish this: the protocol provided example and a third-party pricer.
NFT Pricing Module
-
Protocol provided example:
-
Ensure the environment variables are set correctly.
-
It allows for setting the prices on a collection and also for individual NFT’s. To use the example:
-
Copy the template from src/example/pricing/ApplicationERC721Pricing.sol to your desired location
-
Change the name of the contract to suit your naming standards
- Do not change the import or parent contract
-
Compile the contract
-
Deploy the contract. (no parameters required)
-
locate the address from the output, example:
-
Set the environment variable
-
-
-
ERC20 Pricing Module
-
Protocol provided example:
-
Ensure the environment variables are set correctly.
-
It allows for setting the prices for fungible tokens. To use the example:
-
Copy the template from src/example/pricing/ApplicationERC20Pricing.sol to your desired location
-
Change the name of the contract to suit your naming standards
- Do not change the import or parent contract
-
Compile the contract
-
Deploy the contract. (no parameters required)
-
locate the address from the output, example:
-
Set the environment variable
-
-
Third-Party Pricing Solutions
To be able to use third-party pricing solutions with the protocol, you must make sure that the third party contract complies with our interfaces. If they don’t, an adapter contract will have to be deployed. For more information see the third-party solution guide.
Pricing Module Configuration
Once your pricing modules have been deployed, it is time to set their addresses in your appManager handler. The appManager handler needs both variables set to work:
Signing with a ruleAdmin private key (see admin roles), do:
- For ERC20 pricer:
- For ERC721 pricer: