StabilityNexus / FairFund

4 stars 4 forks source link

Refactor Funding Vault Smart Contract for Better Readability and Extensibility #35

Open adityabhattad2021 opened 1 month ago

adityabhattad2021 commented 1 month ago

The current funding vault smart contract is somewhat rigid and difficult to read due to its large size. To improve readability and maintainability, we propose breaking the smart contract into multiple parts. This can be achieved by:

  1. Creating a base smart contract with the main functions.
  2. Implementing separate smart contracts that inherit from the base smart contract and include customized functions for specific use cases.

This approach will make the funding vault more extendible and adaptable for future enhancements as well.

adityabhattad2021 commented 1 month ago

Here are some use cases:

1 - a DAO has a treasury and DAO members have DAO tokens. The DAO has a grants program. On every round of the grants program, the DAO needs a funding vault. It allocates a portion of the treasury to the funding vault. The DAO tokens are used as voting tokens. Projects willing to apply for the round submit proposals to the funding vault. (This is use case is the one most similar to the current UI.)

2 - a team wishes to attract funding from a community. The team creates a proposal and a vault containing this proposal is automatically created. People from the community deposit funding tokens into the vault and these are automatically counted as votes for the proposal. If the proposal is successful, the funders receive proof-of-funding tokens.