Skip to content

Commit

Permalink
feat(README.md): add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacharbon authored Sep 5, 2024
1 parent 63d8afe commit 2e74694
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions p2p/7.Voting-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ forge test

if the two tests are good, you can move on the second step !

### 📚 **Documentation**:

- [Constructors](https://docs.soliditylang.org/en/v0.8.27/contracts.html#constructors)

## Step 2: Deploy and integrate it

### 📑 **Description**:
Expand All @@ -60,12 +64,16 @@ In this step you'll focus on the deployment and the integration part of your sma
### 📌 **Tasks**:

- Using Anvil and forge, deploy your smart contract on a local testnet.
- Paste the address of your deployed contract into the environment file at the root of the dApp folder.
- Paste the address of your deployed contract into the environment file at the root of the dApp folder named `VITE_ADDRESS`.

### ✔️ **Validation**:

Once you have done this, you should now be able to see the parameters you entered when deploying the contract in the dApp.

### 📚 **Documentation**:

- [Anvil](https://book.getfoundry.sh/anvil/)

## Step 4: Code the contract

### 📑 **Description**:
Expand All @@ -80,14 +88,18 @@ Crucial step! I'll leave you to code the rest of the contract yourself, so you c
- Check if the voter had already voted and if the id is correct.
- Add a `voteCount` for the proposal.

> 💡 These functions require a wallet address. If you've written `anvil` before, you have account available to use. Put one of the private keys in the `.env` file.
> 💡 These functions require a wallet address. If you've did the previous step correctly, you have account available to use. Put one of the private keys in the `.env` file.
- Code the `winningProposal` function, returning the proposal with the most `voteCount`.

### ✔️ **Validation**:

If you can see all the proposals, vote for one and the winner is highlighted in green, congratulations, you have just made your first smart contract !

## To go further

You've just created a simple voting system smart contract ! If you want to go further you can add some feature to your contract and styling the dApp !

## Authors

| [<img src="https://github.com/Sacharbon.png?size=85" width=85><br><sub>Sacha Dujardin</sub>](https://github.com/Sacharbon) |
Expand Down Expand Up @@ -116,4 +128,4 @@ Organization
</a>
</p>

> 🚀 Don't hesitate to follow us on our different networks, and put a star 🌟 on `PoC's` repositories.
> 🚀 Don't hesitate to follow us on our different networks, and put a star 🌟 on `PoC's` repositories.

0 comments on commit 2e74694

Please sign in to comment.