June 16, 2024
Project Background
Website Details
- Inverse Finance is a decentralized autonomous organization (DAO) that focuses on developing and managing various DeFi products. The main products offered by Inverse Finance include:
- FiRM: A fixed-rate lending market where users can borrow assets at a stable interest rate.
- DOLA: A decentralized stablecoin pegged to the U.S. dollar.
- sDOLA: A yield-bearing version of the DOLA stablecoin, which allows users to earn interest on their holdings.
- DBR (Debt Backed Reserve): A token that helps service DOLA loans on the firm platform.
- Inverse Finance operates with a strong emphasis on transparency and community governance. The governance framework allows users to participate in decision-making processes through proposals and voting. The platform also provides detailed information about its treasury and other financial metrics, ensuring a high level of transparency.
Website: inverse.finance
Code Details
This Solidity code defines an ERC20 token that is mintable and burnable via a bridge contract, specifically designed to work with the Optimism Layer 2 solution. Here’s an overview of the key components and functionalities:
Core Contract:
- Semver: Handles semantic versioning with `MAJOR_VERSION`, `MINOR_VERSION`, and `PATCH_VERSION`.
- ERC20:
-
- Implements the standard ERC20 functionality with additional internal functions to handle minting, burning, allowances, and token transfers.
- Functions include `name`, `symbol`, `decimals`, `totalSupply`, `balanceOf`, `transfer`, `allowance`, `approve`, `transferFrom`, `increaseAllowance`, `decreaseAllowance`, `_transfer`, `_mint`, `_burn`, `_approve`, `_spendAllowance`, `_beforeTokenTransfer`, and `_afterTokenTransfer`.
- OptimismMintableERC20:
-
- Extends `ERC20` and `Semver` to create a mintable and burnable token for use with the Optimism bridge.
- The constructor takes parameters for the bridge address, remote token address, token name, and symbol.
- The `mint` and `burn` functions can only be called by the bridge contract.
- Implements `supportsInterface` for interface detection.
This structure ensures that the token adheres to the ERC20 standard while adding the necessary functionalities for integration with the Optimism Layer 2 solution, specifically for minting and burning tokens via a designated bridge contract.