Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-preview.infinifi.xyz/llms.txt

Use this file to discover all available pages before exploring further.

CoreControlled.sol

Purpose: Base contract that enables role-based access control by referencing the InfiniFiCore registry.

Description

CoreControlled is an abstract contract that other protocol contracts inherit from to gain access to the role-based permission system. It maintains a reference to the InfiniFiCore contract and provides modifiers for role checks.

Usage

Contracts inheriting from CoreControlled can use the onlyCoreRole modifier to restrict function access:
contract MyContract is CoreControlled {
    function sensitiveOperation() external onlyCoreRole(CoreRoles.GOVERNOR) {
        // Only GOVERNOR can call this
    }
}

Modifiers

onlyCoreRole

modifier onlyCoreRole(bytes32 role)
Restricts function access to addresses that hold the specified role in the InfiniFiCore registry.

Integration

All protocol contracts that require access control should:
  1. Inherit from CoreControlled
  2. Accept the InfiniFiCore address in their constructor
  3. Use onlyCoreRole modifiers on sensitive functions