Cascading donations
A Soroban smart contract that allows donations to be automatically distributed to other donation contract instances or individuals.
This smart contract allows for the construction of cascading donation schemes for a variety of causes. For example, donations to the supply chain of an open-source library.
Contract workflow
Prerequisites
A token contract used by the donation scheme.
A donor account within the token balance.
Valid accounts for the individuals.
Other
CascadingDonations
contracts, previously registered in the network.
Workflow
Define your distribution rules.
Set up your recipients, they can be single accounts for individuals or other
CascadingDonation
contracts registered in the network (with a validcontract_id
).Set a custom name for each recipient (max. 10 characters).
Define the portion of the donation that each recipient will receive. Expressed as integer values. (20% -> 20).
Initialize the
CascadingDonations
root contract including your recipients and donation token.As a donor, donate to the
CascadingDonations
root contract.If the donation scheme has been set up correctly, all recipients should automatically receive their share of the donation.
Note: The donation contracts will maintain the balance of the remaining tokens that are not defined in the distribution rules.
Setup
Soroban setup
For setting up your environment, visit: Soroban Setup
Contract code
Clone this GitHub repository.
Test
For testing the contract run:
Last updated