Townhall
  • 👋Welcome to Townhall Docs
  • Overview
    • 💡About Townhall
    • ✨Features
  • Product Guides
    • 🏠Houses
      • â„šī¸What is a House?
      • đŸ’ģCreate a House
        • 🔗Register an ENS domain
      • 📍Claim your House
      • âš™ī¸Settings
    • âœ‰ī¸Proposals
      • đŸ’ģCreate a Proposal
      • 📠Edit a Proposal
    • đŸ—¨ī¸Discussions
      • đŸ—Ŗī¸Start a discussion
    • đŸ—ŗī¸Voting
      • â„šī¸How to Vote
      • đŸ—ƒī¸Voting Types
    • 👩‍đŸĢDelegation
      • How to Delegate
    • 💰Treasury
      • Connecting Treasury
    • đŸĻBounties
    • đŸ’ģStrategies
      • 👾Voting Strategies
        • One Person , One Vote
        • Token Weighted Strategy
          • Balance of ERC20
          • Balance of ERC1155
          • Balance of ERC721
        • Custom
    • 🧩Integrations
      • ⚡Importing Snapshot
      • đŸ’ŦDiscourse
    • đŸ’ŗProfile
    • â†—ī¸Invite
    • 🌟Upcoming Features
  • Using Townhall
    • đŸ› ī¸TL;DR
      • 🧑Inviting Members
    • 👩‍đŸ’ŧFor Admins
    • đŸ‘ĨFor Users
  • â˜Žī¸Get in Touch
    • Support team
    • Book a Demo ( For L1s and L2s)
    • Product Bugs
Powered by GitBook
On this page
  • What is a voting strategy?
  • How to set up a strategy?
  1. Product Guides
  2. Strategies

Voting Strategies

Learn what a voting strategy is and how to set it up.

PreviousStrategiesNextOne Person , One Vote

Last updated 1 year ago

What is a voting strategy?

Voting strategy is a set of conditions used to calculate user's voting power. Strategies enable Townhall to calculate the final result of voting on a given proposal.

In technical terms a strategy is a JavaScript function that returns a score for a set of addresses.

Strategy/-ies are defined in the house settings in Voting Strategies section. Each house can select from one up to eight voting strategies. The default strategy is - it calculates the balance of a predefined ERC20 token for each user. Voting strategies can be used to create a score from on-chain data, the data however does not necessarily need to be monetary. As an example a strategy can calculate how many POAPs or specific NFTs a user owns.

If you can't find a strategy that fulfills your needs you can create a new one.

How to set up a strategy?

Majority of houses on Townhall use a single strategy however if you need a more complex calculation, you can combine up to 8 strategies. They will be applied to all proposals created for your house (created after the update of the settings) and the voting power will be calculated cumulatively.

Multiple voting strategies : If you combine several voting strategies the voting power will be calculated in the following way: total voting power = voting power from strategy A + voting power from strategy B + ...

In order to set up a voting strategy ,head to your house settings and scroll down to Strategies section. You should see the below pop-up after clicking Add strategy and selecting a strategy from the list.

You will see that there is information that you need to provide in order to make the strategy work, for example the network where the token is deployed, its symbol and address of the token's contract.

Each strategy will require a different setup and you can read the full description and see the required parameters in the strategy's page, for example . You can find each strategy's details here.

đŸ’ģ
👾
erc20-balance-of
erc20-balance-of