> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infinifi.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# CoreControlled.sol

> Base contract for role-based access control

**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:

```solidity theme={null}
contract MyContract is CoreControlled {
    function sensitiveOperation() external onlyCoreRole(CoreRoles.GOVERNOR) {
        // Only GOVERNOR can call this
    }
}
```

## Modifiers

### `onlyCoreRole`

```solidity theme={null}
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
