$ show HipoFinance/contract
The repository implements Hipo, a decentralized liquid staking protocol on the TON blockchain. Users deposit GRAM to receive hGRAM tokens representing a share in a staking pool that lends to validators for validation rounds. Rewards increase the hGRAM/GRAM exchange rate, accruing value to stakers. The system features a modular smart contract architecture with upgradeable contracts (Treasury, Parent, Wallet, Loan, Bill, Collection, Librarian), a participation state machine tracking validation rounds, and a library management system for code reuse. It includes a comprehensive test suite with custom Jest matchers, deployment scripts, and diagnostic tools for monitoring state and analytics.
The LLM identified 3 files worth highlighting for reuse:
Contains reusable functions for setting up TON sandbox, deploying contracts, creating validator sets, and generating test messages. Isolated from project-specific logic and can be extracted for use in other TON smart contract projects with minimal modification.
Defines custom Jest matchers (toBeBetween, toBeGramValue) for TON-specific assertions. Encapsulates complex validation logic for blockchain values and ranges, providing a reusable testing utility that could be adopted in any TON/TYPEScript project.
Implements a library management pattern for upgradeable contracts, allowing shared code cells to be stored and referenced via the Librarian contract. Reduces code duplication across upgradeable contracts (Wallet, Loan, Bill) and demonstrates a non-obvious solution to a common upgradeability challenge in blockchain development.