A collection of smart contracts for the Brewit platform, including badge management, smart sessions, and WebAuthn validation.
This repository contains several key components:
-
Badges System
- ERC1155-based soulbound badges
- Signature-based minting
- Flexible token rendering
- Role-based access control
-
Smart Sessions
- ERC-7579 compatible smart account sessions
- Granular control over session keys
- Support for various policy types
- Integration with external policy contracts
-
WebAuthn Validators
- WebAuthn2/FIDO2 authentication
- ECDSA P256 optimization
- FreshCryptoLib integration
- Clone the repository:
git clone <repository-url>
cd brewit-contracts
- Install dependencies:
forge install
- Create a
.env
file with your configuration:
PRIVATE_KEY=your_private_key
API_KEY_ALCHEMY=your_alchemy_key
ETHERSCAN_API_KEY=your_etherscan_key
# Add other API keys as needed
Run tests for all components:
forge test
Run tests for specific components:
# Badges
cd badges && forge test
# Smart Sessions
cd smartsessions && forge test
# WebAuthn Validators
cd validators/webauthn && forge test
Deploy to a network:
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --broadcast
The badge system implements ERC1155 tokens with soulbound functionality:
- Non-transferable tokens
- Signature-based minting
- Customizable token rendering
- Role-based access control
Smart session management for ERC-7579 accounts:
- Session key management
- Policy-based access control
- ERC-1271 signature validation
- Batched execution support
WebAuthn2/FIDO2 authentication implementation:
- ECDSA P256 optimization
- FreshCryptoLib integration
- Gas-optimized verification
- Comprehensive test coverage
This project is in active development. Use at your own risk.
MIT License