r4bbit 974ec940d1 fix: ensure cooldownPeriod check is done correctly
The `FeaturedVotingContract` comes with a check in `initializeVoting()`
that aims to ensure that the community that the voting is being
initialized for, has not been featured previously for #n votings.

This is denoted as the `cooldownPeriod`. If `cooldownPeriod = 1`, this
means there needs to be at least one voting which doesn't include the
community in question, that came *after* the voting that did.

The internal `_isInCooldownPeriod()` check has a bug which will return
false positives for any communiy that has been featured before,
regardless of `cooldownPeriod`s value.

When iterating previous votings, the contract actually needs to start
with the last one and iterate downwards, however it does the opposite so
it will never reach the correct votings to check.

This commit fixes the check and adds two tests to cover the case
accordingly.
2023-05-18 11:21:08 +02:00
2021-06-02 10:51:58 +02:00
2021-08-05 16:39:21 +02:00
2021-06-28 13:43:22 +02:00
2021-06-30 11:48:42 +02:00
2021-06-23 09:43:19 +02:00
2023-05-05 19:45:39 +02:00
2023-05-12 11:50:59 +02:00
2023-05-12 11:50:59 +02:00
2023-05-04 14:11:41 +02:00

status-community-dapp

Community directory curator dApp for Status

API

Proposed api is available here

Running the project

Note: Use node v18.15.0

  1. Install dependencies: Run yarn to install the necessary packages and dependencies.
  2. Run local hardhat node: Navigate to the packages/contract directory and run yarn dev.
  3. Deploy contracts: Navigate to the packages/contracts directory and run yarn dev:deploy to deploy the contracts needed for the project.
  4. Start the app: Run VOTING_CONTRACT=hex_addr DIRECTORY_CONTRACT=hex_addr MULTICALL_CONTRACT=hex_addr TOKEN_CONTRACT=hex_addr yarn dev to start the application. Make sure to replace hex_addr with the actual addresses of the contracts you deployed in step 3.

Once the app is run, connect to the wallet. NOTE: in 'production' mode it has to be Status wallet.

Description
Community directory curator dApp for Status
https://status-community-dapp.vercel.app
Readme
Languages
TypeScript 98.7%
JavaScript 1.2%
HTML 0.1%