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.

  • Strategy - base strategy contract
  • Registry - handles registration and approvals of projects and applications
  • Allocator - handles token transfers to and from strategy 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, approve, allocate, and distribute.
  • Indexer will automatically index all Initialize, Register, Approve, 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() - created strategies
  • useRegister(strategyAddress) - register projects and applications
  • useApprove(strategyAddress) - review and approve projects and applications
  • useAllocate(strategyAddress) - transfer tokens to an address (donations, funding, voting)
  • useDistribute(strategyAddress) - transfer tokens from the strategy (matching funds, etc)
  • useRegistrations(query) - query projects, applications, reviews
  • useAllocations(query) - query any token transfers in relation to the strategy
Last updated on