staking vault that allows users to deposit Chiliz (CHZ) as collateral to borrow and staking
A decentralized finance (DeFi) application designed for the Chiliz ecosystem. It empowers CHZ token holders to unlock liquidity from their assets without needing to sell them. By connecting a Web3 wallet, users can securely deposit their Chiliz tokens into the vault. In exchange, they can borrow DebtToken, a synthetic stablecoin, against their collateral. While the tokens are deposited, users continue to accumulate staking rewards, making it a powerful tool for leveraging assets.
This application was constructed using a modern Web3 technology stack. The on-chain logic is powered by Solidity smart contracts, which were developed and tested using the Foundry framework. These contracts, responsible for managing collateral and debt, are built upon the secure and standardized OpenZeppelin ERC20 token implementation. The user-facing application is a React frontend built with TypeScript and Vite, providing a fast and interactive experience. To handle blockchain interactions—such as connecting wallets, fetching balances, and sending transactions—we integrated the powerful wagmi and viem libraries. A key part of the development process involved diagnosing and resolving a complex Content Security Policy (CSP) issue related to web workers in Vite, which was fixed by implementing a robust CSP header and refactoring the application's data-fetching logic for greater reliability.