LogoLogo
  • Tally Docs
  • Tally Features
    • What is Tally?
    • Token Launch
      • Claim
      • Governance Smart Contracts
      • Token Wrapper
      • Delegate Registration & Claim-and-Delegate
    • Value Accrual with Staking
      • Features & Use Cases
      • FAQ
      • Glossary
    • Governance
      • Advanced Features
        • MultiGov
        • Advanced Voting
          • Flexible Voting Extension
          • Signal Voting
            • Snapshot
          • Private Voting
        • Partial Delegation
        • Security Council Elections
        • Chain Integration
        • Proposal Templates
        • Optimistic Governance
        • Gasless Voting and Delegation (Relay)
          • Gasless Voting
          • Gasless Delegation
        • Integrations
          • Karma - Delegate Scoring
          • Discourse
          • Safe
      • Standard Features
    • Tally API
    • Tally Zero
  • How to Use Tally
    • Navigate the Tally homepage
    • Set up a Tally Profile
    • Create Proposals
      • Custom Actions
        • Chain Deployment of Uniswap v3
        • Token Vesting with Hedgey
        • Token Grants with Hedgey
        • Streaming Payments with Sablier
        • Tuple Support
      • Swaps
        • Swaps: FAQs
      • Draft Proposals
      • Test Proposals
    • Execute Proposals
      • Advanced Execution
    • Delegate on Tally
      • Delegates Page
      • Delegate Voting Power
      • Create a Delegate Statement
    • Vote on Tally
    • Stake on Tally
    • Get Notifications on Tally
    • Use Tally with a Gnosis Safe
      • Vote with a Gnosis Safe
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Participate in Security Council Elections
    • Using Ledger with Solana
  • Set up & Technical Documentation
    • Tally Architecture
    • Deploy a Governor DAO
      • Deploy a Governor
        • Deploy a Governor with a new token
      • Add a Governor to an existing token
      • Check for Token Contract Compatibility
        • Network Support
        • OpenZeppelin Governor
        • Compound Governor Bravo
        • Tokens: ERC-20 and NFTs
      • Choose Governor parameters
    • Add a DAO to Tally
      • DAO Admins
      • DAO Settings
    • Use Governor with Gnosis Safe
      • Gnosis Safe Overview
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Staking Contracts
      • Get Started
      • How Staking Works
        • Liquid Staking
          • LST Auto delegates
      • Staking Operator's Guide
      • DeFi Integration Guide
      • FAQ & Troubleshooting
    • Security
    • Chain Compatibility
  • Education
    • Intro to Governance
      • General Ecosystem Info
      • Participating in Governance
    • Governance Concepts
      • Decentralized Governance Overview
      • Onchain vs Offchain Voting
      • Application Layer vs. Base Layer Governance
      • Governance Execution Methods
      • Procedural Governance
      • Vote Delegation
    • Governance Frameworks
      • OpenZeppelin Governor
      • Curve Voting Escrow
      • Multisigs
      • Snapshot Polls
    • DAO Best Practices
      • Running an Onchain DAO Using OpenZeppelin Governor
    • Index of DAOs
      • DAOs on Tally
        • Aave (AAVE)
        • Ampleforth (FORTH)
        • Arbitrum (ARB)
        • Compound (COMP)
        • Gitcoin (GTC)
        • GMX
        • Idle Finance (IDLE)
        • Inverse Finance (INV)
        • PoolTogether (POOL)
        • Uniswap (UNI)
        • ZKsync
      • DAOs Not on Tally
        • Balancer (BAL)
        • Curve (CRV)
        • Index Coop (INDEX)
        • KyberDAO (KNC)
        • MakerDAO (MKR)
        • Sushi (SUSHI)
  • Resources
    • Tally Platform
    • Blog
    • DAO Talk Podcast
    • Newsletter
    • Twitter / X
  • Payment Addresses
Powered by GitBook
On this page
  • Event signatures
  • Function signatures

Was this helpful?

Export as PDF
  1. Set up & Technical Documentation
  2. Deploy a Governor DAO
  3. Check for Token Contract Compatibility

Tokens: ERC-20 and NFTs

How to make an ERC-20 or ERC-721 token contract that will work with onchain governance.

PreviousCompound Governor BravoNextChoose Governor parameters

Last updated 4 months ago

Was this helpful?

Tally expects tokens to implement the relevant standard, like or . Also, Tally needs the token contract to implement the for delegation and voting power checkpointing.

Specifically, Tally needs the following methods and event signatures for indexing and web3 calls:

Event signatures

Tally's API listens to event logs from token contracts when indexing them. Your token contract will need to maintain the same event signatures:

event DelegateVotesChanged(
    address indexed delegate, 
    uint previousBalance, 
    uint newBalance
);
event DelegateChanged(
    address indexed delegator, 
    address indexed fromDelegate, 
    address indexed toDelegate
);

Your contract will need to support transfer events, too. Tally works with both ERC20 transfer events and ERC721 events.

ERC20:

event Transfer(
    address indexed from, 
    address indexed to, 
    uint256 amount
);

ERC721:

  event Transfer(
    address indexed from, 
    address indexed to, 
    uint256 indexed tokenId
);

Function signatures

The Tally frontend helps users make these function calls to delegate their votes:

function delegate(address delegatee)
function delegateBySig(
    address delegatee, 
    uint nonce, 
    uint expiry, 
    uint8 v, 
    bytes32 r, 
    bytes32 s
)
function getVotes(address account) uint256
function name() string
function symbol() string

// ERC20 only:
function decimals() public view returns (uint8) 

Name

The token contract must implement the name() function, so that Tally knows what to call the token.

function name() string

Symbol

The token contract must implement a symbol() function, so that Tally knows the short name of the token.

function symbol() string

Decimals

ERC20 token contracts must implement a decimals() function, so that Tally can correctly render token balances:

function decimals() public view returns (uint8) 

Your token contract also needs to implement voting and delegation functions. If you are using an ERC20 token, you can use the or the extensions from the OpenZeppelin token contracts library.

If you're using an ERC71 token, you can use OpenZeppelin's draft extension.

ERC-20
ERC-721
EIP-5805 standard
ERC20Votes
ERC20VotesComp
ERC721Votes