About
## Wave 1 submission
MadeInBear is a confidential lending protocol for institutions, combining a Compound V2-style money market with Fhenix's Fully Homomorphic Encryption. It enables private participation with encrypted positions, on-chain KYC credentialing, and built-in compliance via selective disclosure (KYT/AML/Travel Rule).
- Product Demo (3 mins.): https://youtu.be/-8zn311NHl0
- Live URL (Sepolia Testnet): https://madeinbear.netlify.app/
Wave #1 focuses on learning and validation—we explored Fhenix FHE through examples and documentation, then built a minimal but complete end-to-end flow (wrap → supply → borrow → unwrap → claim). Since FHE was still a black box, we kept the design simple to reduce complexity and ensure the core system works before adding full economics.
When accessing our dApp, you can:
- Connect wallet and authorize decryption for Fhenix FHE operations - Wrap tokens: convert ERC-20 (USDT/WETH) into confidential tokens (FHERC20) - Unwrap & claim: convert back to ERC-20 and withdraw tokens - Supply & borrow with encrypted state tracking (no actual transfers in this version) - Track private positions via on-chain decryption using decryptForView()
Core smart contracts combine Compound V2 design with Fhenix FHE:
1. CToken.sol (Confidential Token)
- Wraps ERC20 into confidential tokens and handles unwrapping/claims - Inherits from Fhenix FHERC20WrappedERC20
- CCToken.sol (Confidential Compound Token)
- Tracks encrypted supply/borrow balances (no transfers yet)
- Fixed rates (3% supply, 5% borrow)
- No health factor (planned next wave), fixed 80% collateral factor
3. Comptroller.sol
- Manages markets and protocol risk parameters
Two key FHE decryption methods for different use cases: 1. decryptForView() - Revealing private data - Used in frontend to view encrypted balances - Requires user signature to decrypt 2. decryptForTx() - Claiming tokens - Used in claim transactions to transfer tokens - Allows smart contracts to use decrypted values
All allows us to achieved a complete user journey this: 1. Wrap (ERC20 → Confidential) - User approves CToken to spend ERC20 - User shields tokens → receives encrypted balance 2. Supply (Confidential → Protocol) - User supplies encrypted tokens to protocol - Protocol tracks encrypted balance 3. Borrow (Against Collateral) - User borrows encrypted tokens - Protocol tracks encrypted debt 4. Unwrap (Confidential → Unshield) - User initiates unwrap - Creates pending claim with decryption signature 5. Claim - User provides decrypted amount + proof - ERC20 tokens transferred to user
This wave gives us a solid base to iterate into a more complete protocol while we've demonstrated:
- ✅ Working FHE encryption for user positions
- ✅ Functional confidential lending operations
- ✅ Complete end-to-end user flow
- ✅ FHE SDK integration with wallet connection
Note: fhenix-confidential-contracts v0.2.1 contains a type mismatch bug preventing compilation. Run patch at `/patches` to fix it.
From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.





