DA0-DA0 / dao-contracts

CosmWasm smart contracts for Interchain DAOs.
https://docs.daodao.zone
BSD 3-Clause "New" or "Revised" License
202 stars 132 forks source link

Distribution #792

Closed JakeHartnell closed 1 month ago

JakeHartnell commented 6 months ago

Closes #667 :tada:

User Story: As a DAO, I want to distribute rewards over time to members based on their voting power or stake.

This PR refactors the old cw20-stake-external-rewards into something that can be used by all types of DAOs. I've tried my best to add more code comments and documentation into this contract as well, hoping to make it a bit more readable as we move forward.

Additionally, I created a new folder distribution as there was starting to be too much in the external contracts folder. I moved cw-fund-distributor there for now.

As for cw20-stake-external-rewards, I have left it where it is for now, but thinking about deleting it...

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 99.79373% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 96.41%. Comparing base (3ab7017) to head (52caad6).

Files Patch % Lines
...stribution/dao-rewards-distributor/src/contract.rs 99.19% 3 Missing :warning:
.../distribution/dao-rewards-distributor/src/error.rs 0.00% 1 Missing :warning:
...ts/distribution/dao-rewards-distributor/src/msg.rs 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #792 +/- ## =============================================== + Coverage 96.26% 96.41% +0.15% =============================================== Files 209 214 +5 Lines 53514 55938 +2424 =============================================== + Hits 51513 53933 +2420 - Misses 2001 2005 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JakeHartnell commented 2 months ago

Note sure why CodeCov is failing, but everything else passes. 🤷‍♂️

bekauz commented 2 months ago

Note sure why CodeCov is failing, but everything else passes. 🤷‍♂️

passes now!

NoahSaso commented 1 month ago

closing in favor of #835