FinGlobal is a DeFi lending platform to deposit collateral and borrow tokens.
LendingPlatform Contract The LendingPlatform is a comprehensive decentralized lending and borrowing protocol designed specifically for the Rootstock network. Key features include: Core Functionality: Collateral Management: Users can deposit supported ERC-20 tokens as collateral Borrowing System: Users can borrow tokens against their collateral with dynamic interest rates Liquidation Mechanism: Automated liquidation of unhealthy positions with authorized liquidators Interest Rate Model: Dynamic interest rates based on utilization rates (5% base + up to 20% based on utilization) Key Parameters: Maximum collateral factor: 90% Maximum liquidation threshold: 95% Liquidation bonus: 5% for liquidators Reserve factor: Up to 50% (configurable per asset) Security Features: ReentrancyGuard protection Owner-only asset management Authorized liquidator system Health check mechanisms for position safety Asset Management: Support for multiple ERC-20 tokens Configurable collateral factors and liquidation thresholds per asset Dynamic interest rate calculations Reserve accumulation for platform stability FinGlobalToken Contract The FinGlobalToken (FGT) is a custom ERC-20 token with the following characteristics: Token Specifications: Name: FinGlobal Token Symbol: FGT Initial Supply: 1,000,000 tokens Maximum Supply: 10,000,000 tokens Decimals: 18 Special Features: Whitelist System: Transfer restrictions with configurable whitelist Controlled Minting: Owner can mint tokens up to maximum supply Access Control: Owner-only functions for whitelist management Compliance Ready: Built-in transfer restrictions for regulatory compliance Use Cases: Primary token for the FinGlobal lending platform Can be used as collateral in the lending system Whitelist functionality enables KYC/AML compliance Controlled token distribution through owner minting This ecosystem provides a complete DeFi solution with both the infrastructure for lending/borrowing and a compliant token system for the Rootstock blockchain.
How It's Made Core Technologies: Solidity ^0.8.20 - Smart contract development Hardhat - Development framework and testing environment OpenZeppelin Contracts - Security-audited contract libraries Rootstock Network - Target blockchain (Bitcoin sidechain) Architecture & Integration: Modular Design: Separate contracts for token (FGT) and lending platform OpenZeppelin Integration: Leverages Ownable, ReentrancyGuard, SafeERC20, and Math libraries for security and gas optimization Event-Driven: Comprehensive event logging for off-chain monitoring and analytics Key Technical Decisions: Interest Rate Model: Custom implementation using utilization-based rates (5% base + up to 20% dynamic) Liquidation System: Automated with 5% bonus incentive for liquidators Whitelist Mechanism: Built-in compliance layer for regulatory requirements Precision Handling: Uses 1e18 precision for accurate calculations Security Features: Reentrancy protection on all external functions SafeERC20 for secure token transfers Owner-only asset management Health check validations before withdrawals Notable Implementation Details: Dynamic Interest Calculation: Real-time rate updates based on supply/demand Cross-Asset Collateral: Users can collateralize multiple assets for single borrows Gas-Optimized Loops: Efficient iteration through asset lists Basis Points System: All percentages stored as basis points (e.g., 7500 = 75%) Development Stack: Hardhat for compilation, testing, and deployment JavaScript for deployment scripts Mocha/Chai for comprehensive test coverage The project demonstrates a production-ready DeFi protocol with enterprise-grade security patterns and compliance features, specifically optimized for the Rootstock ecosystem.

