UniversityDAO / udao

The official UniversityDAO DApp repository.
GNU Lesser General Public License v2.1
4 stars 4 forks source link

IPFS and Ethers connection organization issue #39

Closed austin-davis1 closed 2 years ago

austin-davis1 commented 2 years ago

With our current setup, we plan to call the propose() function using Ethers and passing in the IPFS CID as part of the hash. This forces us to upload to IPFS before we call propose(), as an IPFS CID is generated upon upload. This creates two problems:

  1. If we upload a file to IPFS then the propose() function fails, we have IPFS data sitting around that has no corresponding blockchain data. There is no easy way to delete this data, so it will just be stuck there when it shouldn't be there at all.
  2. We have to store Proposal ID's (the return value of propose()) anyways, so by uploading to IPFS before calling propose() we would be forced to create a new file to store every Proposal ID since we cannot append it to an existing proposal. This means every proposal or grant has two files for each entry, and this would drastically increase overall complexity and overhead on the frontend side.
austin-davis1 commented 2 years ago

We solved this issue by pulling Proposal IDs from the blockchain (filtering ProposalCreated events) rather than trying to store them on IPFS. Problem 1 may be addressed by finding a method to generate a CID without actually pushing to IPFS first. Closing this issue.