This PR addresses the functionality to allow users to withdraw remaining tokens from the funding vault after the tally date has passed. The following changes have been implemented:
Smart Contract
Added a variable to keep track of the total funds distributed.
Introduced a mapping to record the amount deposited by each user.
Implemented a function to withdraw remaining funds post-distribution.
Added relevant getter functions to retrieve necessary data.
Included tests to ensure the new functionality works correctly.
Database
Added an isDistributed variable for the funding vault to track the distribution status.
API Routes
Added an API route to update the funding vault information, (for now to update the isDistributed field).
Frontend
Modified the "Distribute Funds" button to update the database after a successful smart contract call.
Added a button for users to withdraw remaining funds post-distribution.
UI Enhancements
Added two additional cards on the results page:
Displaying the amount of funds actually distributed.
Indicating whether the funds have been distributed.
Differentiated cards for actions post-tally and post-distribution to improve user experience.
Description:
Closes #21
This PR addresses the functionality to allow users to withdraw remaining tokens from the funding vault after the tally date has passed. The following changes have been implemented:
Smart Contract
Database
isDistributed
variable for the funding vault to track the distribution status.API Routes
isDistributed
field).Frontend
UI Enhancements