Main

🧭 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

Returns the address of the token used as collateral across the protocol (e.g., USDC).

getCollateralTokenDecimals() β†’ uint256

Returns the number of decimals used by the collateral token.

getCollateralPool() β†’ address

Returns the address of the deployed CollateralPool contract.

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

Returns the penalty rate applied to undercollateralized users when liquidated. Default: 12% (represented as 12e16).

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

Returns the protocol fee rate.


πŸ”„ Internal Parameters

Parameter
Description
Default Value

_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

Feature
Role

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