{"id":20060607,"url":"https://github.com/oasisprotocol/dapp-blockvote","last_synced_at":"2025-06-25T13:04:10.736Z","repository":{"id":247183481,"uuid":"822852760","full_name":"oasisprotocol/dapp-blockvote","owner":"oasisprotocol","description":"Side DAO - Private Sidekick for DAOs.","archived":false,"fork":false,"pushed_at":"2025-06-25T11:10:56.000Z","size":9785,"stargazers_count":1,"open_issues_count":23,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-25T13:03:58.992Z","etag":null,"topics":["cross-chain","dao","oasis","privacy","sapphire","voting"],"latest_commit_sha":null,"homepage":"https://vote.oasis.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oasisprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-02T00:54:01.000Z","updated_at":"2025-06-24T17:32:41.000Z","dependencies_parsed_at":"2024-07-23T01:11:20.520Z","dependency_job_id":"05a46ed0-fd4f-45d7-9b24-08526bb59a4a","html_url":"https://github.com/oasisprotocol/dapp-blockvote","commit_stats":null,"previous_names":["oasisprotocol/dapp-sidedao","oasisprotocol/dapp-blockvote"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oasisprotocol/dapp-blockvote","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdapp-blockvote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdapp-blockvote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdapp-blockvote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdapp-blockvote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oasisprotocol","download_url":"https://codeload.github.com/oasisprotocol/dapp-blockvote/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasisprotocol%2Fdapp-blockvote/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261879271,"owners_count":23223736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-chain","dao","oasis","privacy","sapphire","voting"],"created_at":"2024-11-13T13:15:55.552Z","updated_at":"2025-06-25T13:04:10.711Z","avatar_url":"https://github.com/oasisprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oasis Blockvote: Private Sidekick for DAOs\n\nThis is a dApp for running ad-hoc unofficial opinion polls for DAO members, or any other group.\n\nThe app is a fork of the [Oasis Demo Voting App],\nwhich is in turn a fork of the [OPL Secret Ballot].\n\n[Oasis Demo Voting App]: https://github.com/oasisprotocol/demo-voting/tree/CedarMist/per-dao-stuff\n[OPL Secret Ballot]: https://github.com/oasisprotocol/playground/tree/main/opl-secret-ballot\n\nThis monorepo is set up for `pnpm`. Install dependencies by running:\n\n```sh\npnpm install\n```\n\n## Backend\n\nMove to the `contracts` folder and build smart contracts:\n\n```sh\npnpm build\n```\n\nNext, deploy the contract.\n\n### Basic Local Hardhat Deployment\n\nMove to the `hardhat` folder and build smart contracts:\n\nStart the hardhat node:\n\n```sh\nmake build\n```\n\nDeploy smart contracts to that local network:\n\n```sh\nmake deploy-localnet\n```\n\nYou can use the `--gaslessAccounts` and `--gaslessFunds` parameters to set\nthe number of proxy accounts that can be used to pay for the gas for voters\nand the amount of tokens each of those accounts will be initially funded.\n\nThe deployed DAO contract addresses will be stored\ninside the `frontend` folder's `.env.development`, for example:\n\n```\nVITE_DAO_V1_ADDR=0x5FbDB2315678afecb367f032d93F642f64180aa3\n```\n\n### Monitoring Signer Accounts\n\nTo monitor accounts, use `gv-topup` providing DAO address which will show the\nbalances:\n\n```shell\npnpm hardhat --network localhost gv-topup --dryrun 0x5FbDB2315678afecb367f032d93F642f64180aa3\n```\n\nTo specify minimum balance for `gv-topup` use `--min`, remove `--dryrun` to\nsubmit the transactions. For example, to top up the accounts so that each\naccount will have 10 tokens, run:\n\n```shell\npnpm hardhat --network localhost gv-topup 0x5FbDB2315678afecb367f032d93F642f64180aa3 --min 10000000000\n```\n\n### Adding Signer Accounts\n\nTo add more signer accounts:\n\n```shell\npnpm hardhat --network localhost gv-newkp 0x5FbDB2315678afecb367f032d93F642f64180aa3\n```\n\n### Access Control Lists (ACL)\n\nUse `--acl` deployment parameter to define the ACL contract policy to use. Supported\nvalues:\n\n- `AllowAllACLv1`: anyone can create a new poll, anyone can close any poll,\n  anyone can vote on any poll\n- `AllowVoterACLv1`: anyone can create a new poll, only contract authors can\n  close the poll, anyone can vote\n- `WhitelistVotersACLv1`: anyone can create a new poll, only contract authors\n  can close the poll, only whitelisted accounts can vote\n\n```shell\nnpx hardhat --network localhost deploy --acl AllowVoterACLv1\n```\n\n#### Whitelisting the Voters (WhitelistVotersACLv1 only)\n\nTo whitelist voters for a specific ballot, gather the following information:\n\n- DAO contract address (reported `VITE_DAO_V1_ADDR`)\n- poll ID (you can copy it from the URL when clicking on a poll)\n- hex-encoded private key of the poll manager (the one that created a poll)\n  stored as `PRIVATE_KEY` environment variable: `export PRIVATE_KEY=0x...`\n\nThen, prepare a file containing whitelisted voters addresses, one per line. This\nlist will overwrite any existing whitelisted users. For example:\n\n``` voters.txt\n0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199\n0xDce075E1C39b1ae0b75D554558b6451A226ffe00\n```\n\nThen, execute the following hardhat task:\n\n```shell\nnpx hardhat --network localhost whitelist-voters 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 e386cceaa6ceea2f935d89951e522ac6d7ac777503b234d61b193439de571cfc voters.txt\n```\n\n### Deploying to Sapphire Localnet, Testnet and Mainnet\n\nPrepare your hex-encoded private key and store it as an environment variable:\n\n```shell\nexport PRIVATE_KEY=0x...\n```\n\nTo deploy the contracts to the [Sapphire Localnet], Testnet or Mainnet, use the\nfollowing commands respectively:\n\n```shell\nnpx hardhat deploy --network sapphire-localnet\nnpx hardhat deploy --network sapphire-testnet\nnpx hardhat deploy --network sapphire\n```\n\n[Sapphire Localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/pkgs/container/sapphire-dev\n\n## Frontend\n\nAfter compiling the backend, updating `.env.development` with the corresponding\nDAO address and chain ID, move to the `frontend` folder to compile and\nHot-Reload frontend for Development:\n\n```sh\npnpm dev\n```\n\nThis will start the React app, using the contracts deployed to Sapphire Localnet.\n\nOr, you can do:\n\n```sh\npnpm dev-staging\n```\n\nThis will also start the React app, but it will use the contracts deployed to Sapphire teestnet.\n\nWhichever backend you want to you, after starting the React app,\nnavigate to http://localhost:5173, and you should be able to create a new poll.\n\n\nIf running against localnet, \nyou can use one of the deployed test accounts and associated private key with\nMetaMask. If you use the same MetaMask accounts on fresh local networks, don't\nforget to *clear your account's activity* each time or manually specify the\ncorrect account nonce.\n\n### Frontend Deployment\n\nYou can build assets for deployment by running:\n\n```sh\npnpm build\n```\n\n`dist` folder will contain the generated HTML artifacts.\n\n#### Different Website Base\n\nIf you are running dApp on a non-root base dir, add\n\n```\nBASE_DIR=/my/public/path\n```\n\nto `.env.production` and bundle the app with\n\n```\npnpm build-only --base=/my/public/path/\n```\n\nThen copy the `dist` folder to a place of your `/my/public/path` location.\n\n## Disclaimer\n\nThis is a demonstration project focused on the confidentiality features of the\nOasis network. The smart contract, backend and frontend code is not audited\nneither can authors of this project, Oasis Foundation or Oasis Labs Inc. be held\nresponsible for any security vulnerabilities, financial and/or data loss or\ntheft.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fdapp-blockvote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foasisprotocol%2Fdapp-blockvote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasisprotocol%2Fdapp-blockvote/lists"}