This is a protocol template for an ERC20-pricing contract. Any custom-made pricing contract that intends to be protocol compliant must implement the IProtocolERC20Pricing interface, and follow the price format guideline. This template is available for developers to quickly get their pricing modules up and running.Documentation Index
Fetch the complete documentation index at: https://thrackle.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Deployment
Refer to the deployment document here.Public Functions
The price-setter function:
Parameters:
- tokenContract (address): the address for the token contract.
- price (uint256): the price in wei of dollars for a whole token (see example).
The price-getter function:
Parameters:
- tokenContract (address): the address for the token contract.
Returns:
- price (uint256): the price in wei of dollars for a whole token (see example).
The version-getter function:
Returns:
- version (string): the string of the protocol version of this template file.
Set an ERC20-Pricing Contract in an Asset Handler
Use the following function in the asset handler:Parameters:
- _address (address): the address of the ERC20 pricing contract.
Events:
- event AD1467_ERC20PricingAddressSet(address indexed _address);
- Parameters:
- _address: the address of the pricing contract.
- Parameters:
Upgrading:
To upgrade the pricing contracts, ensure your new pricing contract is deployed to the same network your Application Handler is deployed to. Next, you will call the appropriate functionsetERC20Pricing or setNFTPricing from the Application Handler contract.