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
, anddistribute
. - 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 strategiesusePools()
- created pools (from deployed strategies)useRegister(poolAddress)
- register projects and applicationsuseReview(poolAddress)
- review (approve or reject) projects and applicationsuseAllocate(poolAddress)
- transfer tokens to an address (donations, funding, voting)useDistribute(poolAddress)
- transfer tokens from the pool (matching funds, etc)useRegistrations(query)
- query projects, applications, reviewsuseAllocations(query)
- query any token transfers in relation to the pool
Last updated on