https://github.com/bastidood/botoken
A simple Arbitrum-based (Ethereum) polling system for decentralized autonomous organizations (DAOs).
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (6.8%) to scientific vocabulary
Keywords
Repository
A simple Arbitrum-based (Ethereum) polling system for decentralized autonomous organizations (DAOs).
Basic Info
- Host: GitHub
- Owner: BastiDood
- License: agpl-3.0
- Language: Svelte
- Default Branch: main
- Homepage: https://botoken.pages.dev/
- Size: 465 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Botoken
Botoken is a simple Arbitrum-based polling system for decentralized autonomous organizations (DAOs) by Basti Ortiz. Botoken aims to create a polling system that fulfills the following goals:
- Voters must be incentivized to vote.
- Poll creators (called "proposers") must be incentivized to set forth new proposals.
The Setup
Each Botoken system is composed of three users: The Botoken smart contract is an ownable ERC20 token, where the owner is the "administrator" or "arbiter" of polls.
- Each Botoken smart contract deployment is an ownable ERC20 token, where the Owner is the only "administrator" or "arbiter" of the polling system.
- The Owner is the one who first deploys the contract.
- The Owner may not participate in or vote on any of the proposals.
- The Owner may mint or inject new tokens into the system at no cost. The zero-cost minting is meant to decouple the monetary value of Ethereum from the abstract value of voting power.
- The Owner may transfer tokens from the contract deployment's "residuals" into another account. More on this in the next section on incentives.
- A fundamental assumption behind the integrity of the system is the fact that the Owner is a trusted disinterested third party with the sole permission to finalize and close polls via timers, cron jobs, etc.
- The rest of the network are called Users.
- Unlike the Owner, a User may create new proposals (called Proposers). Proposers are not allowed to vote on their own polls.
- Unlike the Owner, a User may vote on existing polls (called Voters). In other words, the Voter is the lifeblood of the system.
The Incentive
The Botoken token is called a botoken (BTK). In this polling system, the BTK is analogous to voting power. Voting in polls involves staking tokens.
- To emphasize the Owner being a disinterested third party, the Owner may not earn from the system. They stand with nothing to gain and nothing to lose.
- To create a new proposal, a Proposer must first stake a user-volunteered amount of BTK. It is up to the Owner to decide what to do with the created poll given greater stakes. For example, the Owner may opt to keep the poll validity time directly proportional to the amount of BTK staked. That is to say, greater stakes inform the Owner to finalize and close polls later. With longer poll validity times being a premium (due to the potential for greater exposure to more Users), this is the typical setup.
- Similarly, all Users must stake a user-volunteered amount of BTK as "voting power" on a poll. Since the polls are typically formulated as "yes" or "no" questions, the result of the poll is internally stored as a signed integer, where a positive value means "yes" while a negative value means "no". A User may therefore opt to (positively or negatively) stake more BTK based on the current state of a poll.
- At the end of every poll (i.e., when the Owner decides to finalize and close the poll), the total staked BTK throughout the entire lifetime of the poll is redistributed evenly among the author and all respondents. Any remainder tokens are transferred into the contract as residuals.
- The Proposer is therefore incentivized to encourage voters to participate in the poll. To begin with, the Proposer is also incentivized to make the proposal a compelling question to attract more voters.
- Meanwhile, Voters have the freedom to participate and exercise their voting power however they see fit. This may mean abstaining from polls to "save up on voting power" for other polls in the future.
- The Owner may then choose to reintroduce residuals into the system by transferring the tokens to a specific user. This is, of course, completely optional. Over time, the Owner may choose to mint and inject new tokens into the system at any time should the need arise to combat token scarcity.
Development
[!IMPORTANT] Botoken uses pnpm as its package and workspace manager.
For smart contract development with Solidity, Botoken uses Hardhat to streamline the deployment process.
For the user interface, Botoken uses the SvelteKit framwork for full-stack web development with JavaScript. To add a cherry on top, Botoken features an installable progressive web application.
Formatters
```bash
Check for formatting errors
pnpm fmt
Apply suggestions from formatter
pnpm fmt:fix ```
Linters
```bash
ESLint
pnpm lint:js
LintHTML
pnpm --filter=botoken-sveltekit lint:html
Stylelint
pnpm --filter=botoken-sveltekit lint:css
Svelte Check
pnpm --filter=botoken-sveltekit lint:svelte ```
Contract Deployment
| Environment Variable | Description |
| ------------------------ | ------------------------------------------------------------------------------- |
| WALLET_PRV_KEY | The private key of the Ethereum wallet for which the contract will be deployed. |
| ARBITRUM_RPC_URL | The JSON RPC API endpoint for Arbitrum Sepolia interactions. |
```bash
Compile the contract and its TypeScript types
pnpm --filter=botoken-hardhat compile
Run unit tests
pnpm --filter=botoken-hardhat test
Deploy the contract to the Arbitrum Sepolia testnet
pnpm --filter=botoken-hardhat deploy:arb ```
User Interface
| Environment Variable | Description |
| --------------------------- | --------------------------------------------- |
| PUBLIC_DEPLOYMENT_ADDRESS | The address of the smart contract deployment. |
```bash
Generate SvelteKit's TypeScript types
pnpm --filter=botoken-sveltekit sync
Start the dev server (with hot module replacement)
pnpm --filter=botoken-sveltekit dev
Build the optimized version of the app
pnpm --filter=botoken-sveltekit build
Host the application locally as if it were in production
pnpm --filter=botoken-sveltekit preview ```
Owner
- Name: Basti Ortiz
- Login: BastiDood
- Kind: user
- Location: Philippines
- Twitter: BastiDood
- Repositories: 2
- Profile: https://github.com/BastiDood
Just some dood hoping to make a career out of typing programming jargon to make stuff work.
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/cache v4 composite
- actions/checkout v4 composite
- @nomicfoundation/hardhat-ethers ^3.0.5 development
- @nomicfoundation/hardhat-toolbox ^4.0.0 development
- @openzeppelin/contracts ^5.0.2 development
- chai ^4.4.1 development
- dotenv ^16.4.5 development
- ethers ^6.11.1 development
- hardhat ^2.22.2 development
- @typescript-eslint/eslint-plugin ^7.3.1 development
- @typescript-eslint/parser ^7.3.1 development
- eslint ^8.57.0 development
- eslint-config-prettier ^9.1.0 development
- eslint-plugin-svelte ^2.35.1 development
- prettier ^3.2.5 development
- prettier-plugin-solidity ^1.3.1 development
- prettier-plugin-svelte ^3.2.2 development
- prettier-plugin-tailwindcss ^0.5.12 development
- 946 dependencies
- @linthtml/linthtml ^0.9.5 development
- @linthtml/linthtml-config-recommended ^0.1.0 development
- @skeletonlabs/skeleton ^2.9.0 development
- @skeletonlabs/tw-plugin ^0.3.1 development
- @steeze-ui/heroicons ^2.3.0 development
- @steeze-ui/octicons ^2.1.1 development
- @steeze-ui/svelte-icon ^1.5.0 development
- @sveltejs/adapter-static ^3.0.1 development
- @sveltejs/kit ^2.5.4 development
- @sveltejs/vite-plugin-svelte ^3.0.2 development
- @tailwindcss/typography ^0.5.10 development
- @types/web-app-manifest ^1.0.8 development
- autoprefixer ^10.4.19 development
- ethers ^6.11.1 development
- htmlnano ^2.1.0 development
- stylelint ^16.2.1 development
- stylelint-config-standard ^36.0.0 development
- stylelint-config-tailwindcss ^0.0.7 development
- svelte ^4.2.12 development
- svelte-check ^3.6.8 development
- tailwindcss ^3.4.1 development
- terser ^5.29.2 development
- typescript ^5.4.3 development
- vite ^5.2.2 development
- vite-plugin-tailwind-purgecss ^0.2.0 development