Main
🧭 Main.sol
Main.sol
The Main
contract acts as the central configuration hub of the Scall.io protocol. It manages key system-wide parameters, connects to other core contracts, and provides administrative control to the protocol owner.
This contract is the backbone that maintains the integrity and coordination of different modules including:
The CollateralPool
The MarketPools (BTC/USDC, ETH/USDC, etc.)
Protocol-wide variables like liquidation thresholds, penalty rates, and fees
🧩 What It Does
Stores and exposes global protocol settings
Links new MarketPools to the system
Defines liquidation and rent behavior across all pools
Maintains reference to the Collateral token and CollateralPool
Restricts sensitive modifications to the owner (DAO-controlled or multisig)
🛠️ Public & External Functions
getCollateralToken() → address
getCollateralToken() → address
Returns the address of the token used as collateral across the protocol (e.g., USDC).
getCollateralTokenDecimals() → uint256
getCollateralTokenDecimals() → uint256
Returns the number of decimals used by the collateral token.
getCollateralPool() → address
getCollateralPool() → address
Returns the address of the deployed CollateralPool
contract.
getLiquidationThreshold() → uint256
getLiquidationThreshold() → uint256
Returns the minimum amount of time (in seconds) required for a contract to become eligible for liquidation. Default: 172800 seconds (≈ 2 days of unpaid rent).
getLiquidationPenalty() → uint256
getLiquidationPenalty() → uint256
Returns the penalty rate applied to undercollateralized users when liquidated.
Default: 12% (represented as 12e16
).
getMinCollateral() → uint256
getMinCollateral() → uint256
Returns the minimum amount of collateral (in seconds of rent) required to open or maintain a position. Default: 604800 seconds (1 week).
getFees() → uint256
getFees() → uint256
Returns the protocol fee rate.
🔄 Internal Parameters
_LIQUIDATIONTHRESHOLD
Max duration without rent before liquidation
172800 seconds (2d)
_LIQUIDATIONPENALTY
Penalty rate on remaining collateral when liquidated
12% (12e16)
_MINCOLLATERAL
Minimum rent coverage required to open/maintain
604800 seconds (1w)
_PROTOCOLFEES
Optional fee taken by the protocol
0%
📌 Summary
Global Config
Defines all liquidation and rent rules
Contract Registry
Links and tracks all MarketPools
Admin-Only Control
Centralizes key governance operations
View Functions
Expose protocol parameters to users & dApps
Last updated