UniversityDAO / udao

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

Create proposals and cast a vote functions implemented #47

Closed jagger-harris closed 2 years ago

jagger-harris commented 2 years ago

What the title says :O

austin-davis1 commented 2 years ago

Is there a particular reason why we're using castVoteWithReason as opposed to just castVote?

jagger-harris commented 2 years ago

Is there a particular reason why we're using castVoteWithReason as opposed to just castVote?

It gives us more options, we can always just pass in a NULL or something.

austin-davis1 commented 2 years ago

The next step after completing the functions themselves and working towards actual React integration is grabbing the address and abi for each of the contracts, plus getting the provider that we set in the app.js file so that we can pass these in as arguments.

For the addresses and abi's, you can just import them from config.js at the top of every page that you need them.

For the provider, you'll have to probably pass it down as props to every page since it's set in app.js (the root). You can do that by something like this for each page:

{<Proposals activeProposals={activeProposals} inactiveProposals={inactiveProposals} provider={provider}/>}

This line in particular would be part of the element tag in each of the Route components located in app.js. The example I used here is just the proposals page by appending a provider prop and passing in the provider variable already present on this page.

jagger-harris commented 2 years ago

Connected the functions together, I also wrote queue and executing the proposals and changed the getContract to Contract.