Skip to Content
Strategy ContractsOverview

Strategy Contracts

A Strategy contract can easily be created by composing extensions and gates. They are inspired by OpenZeppelin’s ERC20, ERC721, and the AccessControl contracts.

  • Pool - base pool contract
  • Gates - modifiers to restrict function calls (eg. via checking token balance, or attestations)

There are some benefits in using the same functions and events for our strategies:

  • Hooks are generated by Wagmi CLI for register, review, allocate, and distribute.
  • Indexer will automatically index all Initialize, Register, Review, Allocate events without us needing to make any changes to it.

This means when we’re building apps we can simply re-use a handful of hooks and the indexer will index these events:

  • useStrategies() - deployed strategies
  • usePools() - created pools (from deployed strategies)
  • useRegister(poolAddress) - register projects and applications
  • useReview(poolAddress) - review (approve or reject) projects and applications
  • useAllocate(poolAddress) - transfer tokens to an address (donations, funding, voting)
  • useDistribute(poolAddress) - transfer tokens from the pool (matching funds, etc)
  • useRegistrations(query) - query projects, applications, reviews
  • useAllocations(query) - query any token transfers in relation to the pool
Last updated on