arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Utilities

Welcome to the Utilities section of Snowcone documentation. In this part, we delve into the various utility functions that Snowcone provides to make your development journey smoother and more efficient.

hashtag
Contents

  1. Project Payer

hashtag
Project Payer

This section explores the Project Payer utility, which is instrumental in managing payments within a Snowcone project. Understand how this utility can simplify transactions for your project.

hashtag
Splits Payer

In this section, we cover the Splits Payer utility. Learn how this feature can help manage and distribute payments among different stakeholders in a project.

We hope this guide helps you understand the various utilities available in the Snowcone protocol. If you have any questions or need further clarification, please reach out to our team.

Splits Payer
Read More
Read More

Project payer

SNOWETHERC20ProjectPayer contracts make it easy to route funds to projects' treasuries from other contracts or within inheriting contracts. This is useful for routing funds to a Snowcone treasury within other contracts such as an NFT's minting function, or creating contracts that will automatically route any received funds to a project's treasury with preconfigured parameters to send along with the payment.

The SNOWETHERC20ProjectPayer can be inherited from any contract to facilitate internal transactions to Snowcone treasuries in AVAX or any ERC-20, assuming the project is using a payment terminal that accepts the tokens. They can also be deployed as standalone project payer copies using SNOWProjectPayerDeployer.

Inheriting SNOWProjectPayer​arrow-up-right

Inheriting from SNOWETHERC20ProjectPayer will give a contract access to a public SNOWProjectPayer.pay(...) function, a public SNOWProjectPayer.addToBalanceOf(...)function, an internal SNOWProjectPayer._pay(...) function, and an internal SNOWProjectPayer._addToBalanceOf(...) function. These can be used from within the contract to route funds to a Snowcone treasury while specifying all relevant parameters to contextualize the payment. Use the internal versions if the inheriting contract has already handled receiving the funds being forwarded.

Follow instructions in Getting started to import the SNOWProjectPayer files into a project.

Splits Payer

SNOWETHERC20SplitsPayer contracts make it easy to route funds to a group of splits from other contracts or within inheriting contracts. This is useful for routing funds to a number of Snowcone project treasuries and other addresses within other contracts such as an NFT marketplaces.

The SNOWETHERC20SplitsPayer can be inherited from any contract to facilitate internal transactions to split groups in AVAX or any ERC-20, assuming the projects in the split group are using a payment terminal that accepts the tokens. They can also be deployed as standalone splits payer copies using SNOWSplitsPayerDeployer.

Inheriting SNOWSplitsPayer​arrow-up-right

Inheriting from SNOWETHERC20SplitsPayer will give a contract access to a public SNOWSplitsPayer.pay(...) function, a public SNOWSplitsPayer.addToBalanceOf(...)function, and two functions SNOWSplitsPayer._payToSplits(...) and SNOWSplitsPayer._payTo(...). These can be used from within the contract to route funds to a group of splits while specifying where leftover funds should go. Use the internal function if the inheriting contract has already handled receiving the funds being forwarded.

Follow instructions in Getting started to import the SNOWSplitsPayer files into a project.