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.

InfiniFiCore.sol

Purpose: Establishes the central authority for role-based access control across the InfiniFi protocol.

Description

InfiniFiCore is the foundational contract responsible for maintaining and enforcing hierarchical role-based permissions throughout the InfiniFi system. Every contract requiring access control should delegate role checks to this core registry.

Constructor

Initializes the core roles structure. The deployer is granted the GOVERNOR role and all critical admin roles are explicitly set under the GOVERNOR’s authority.
This is a one-time setup mechanism. After deployment, the deployer is expected to renounce their elevated privileges.

Errors

ErrorDescription
RoleAlreadyExists(bytes32 role)Thrown when re-registering an existing role
RoleDoesNotExist(bytes32 role)Thrown when accessing undefined role
LengthMismatch(uint256, uint256)Thrown on array length mismatch in batch operations

Functions

createRole

function createRole(bytes32 role, bytes32 adminRole) external onlyRole(CoreRoles.GOVERNOR)
Creates a new access control role dynamically. Parameters:
  • role: The new role identifier
  • adminRole: The admin role that governs the new role

setRoleAdmin

function setRoleAdmin(bytes32 role, bytes32 adminRole) external onlyRole(CoreRoles.GOVERNOR)
Reassigns the admin controller for an existing role.

grantRoles

function grantRoles(bytes32[] calldata roles, address[] calldata accounts) external
Batch operation to grant multiple roles to multiple accounts.
Caller must have administrative rights over each role being granted.