This challenge involves building a complete governance system with token delegation functionality. You'll work with smart contracts, frontend development, and blockchain indexing to create a comprehensive governance solution.
Create a governance token that supports delegation:
- Use
ERC20Votes
orERC721Votes
from OpenZeppelin - Implement proper delegation mechanics
- Include permit functionality for gasless approvals
- Ensure the token can be used for voting power delegation\
The governance token should:
- Inherit from
ERC20
,ERC20Permit
, andERC20Votes
(or 721) - Implement required function overrides
Use Ponder to index delegation events:
- Create database schema
- Index relevant events around delegation
- Real-time updates when new delegations occur
Schema considerations:
- Delegation entities with delegator/delegatee relationships
- Historical delegation data
- Event timestamps and block numbers
Bonus Points:
- Implement delegate removal functionality
Build a user interface for token delegation:
- Display token balance and voting power
- Allow users to delegate their tokens to other addresses
- Show delegation history and current delegations
- Responsive design for mobile and desktop
Key features:
- Transaction status feedback
- Error handling for failed transactions
Bonus Points:
- Add delegation historical chart
- Real-time balance updates (relying on real time state management like SWR, react-query)
blockful-challenge-governor/
├── apps/
│ ├── contracts/ # Smart contracts (Foundry)
│ │ ├── src/
│ │ │ └── GovToken.sol
│ │ ├── script/
│ │ └── tests/
│ ├── frontend/ # Next.js frontend
│ │ ├── src/
│ │ │ └── app/
│ │ └── public/
│ └── indexer/ # Ponder indexer
│ ├── src/
│ ├── abis/
│ └── ponder.config.ts
├── package.json
└── pnpm-workspace.yaml
- Node.js 18+
- pnpm
- Foundry (for smart contracts)
- Clone the repository
- Install dependencies:
pnpm install
- Set up environment variables:
PRIVATE_KEY=your_private_key
RPC_URL=your_rpc_url
-
Smart Contract Quality
- Proper implementation of ERC20Votes
- Security best practices
- Gas optimization
- Comprehensive tests
-
Indexing Implementation
- Accurate event indexing
- Efficient data storage
- API performance
- Data consistency
-
Frontend User Experience
- Intuitive delegation interface
- Responsive design
- Error handling
- Real-time updates
-
Code Quality
- Clean, readable code
- Proper documentation
- TypeScript usage
- Error handling
- Complete the implementation according to requirements
- Ensure all tests pass
- Document any assumptions or design decisions
- Provide deployment instructions
- Include a brief demo video or screenshots
If you have questions about the challenge requirements, please reach out to the Blockful team.
Good luck! 🚀