Control Facet

Overview

The Control Facet provides the following key functionalities:

  • Role Management: Grant, revoke, and configure role admins for the Account Layer's access control system.

  • Pause Control: Pause and unpause the entire Account Layer diamond.

  • Account Configuration: Set the AccountManager proxy bytecode and the global signer.

  • Affiliate Configuration: Configure the Symmio fee receiver, whitelist Symmio cores, manage hook and call selector permissions, and add Symmio cores to active affiliates.


Role Management

grantRole() / revokeRole()

Grants or revokes a role. Caller must be an admin for that role.

function grantRole(address user, bytes32 role) external onlyRoleAdmin(role);
function revokeRole(address user, bytes32 role) external onlyRoleAdmin(role);

Events: RoleGranted(bytes32 role, address user, address admin) / RoleRevoked(bytes32 role, address user, address admin)

setRoleAdmin()

Adds or removes a user as a role admin for a specific role. Requires DEFAULT_ADMIN_ROLE.

function setRoleAdmin(address user, bytes32 role, bool status) external onlyRole(DEFAULT_ADMIN_ROLE);

Events: RoleAdminSet(bytes32 role, address user, bool status, address admin)


Pause Control

pause() / unpause()

Pauses or unpauses all state-changing operations on the Account Layer diamond.


Account Configuration

setAccountManagerImplementation()

Sets the bytecode used to deploy new AccountManager proxy contracts when affiliates are approved.

Events: AccountManagerImplementationUpdated(bytes oldImplementation, bytes newImplementation)

setSigner()

Sets the global signer for protocol-level operations. Pass address(0) to clear.

Events: SignerUpdated(address oldSigner, address newSigner)


Affiliate Configuration

setSymmioFeeReceiver()

Sets the address that receives Symmio's share of affiliate fees.

Events: SymmioFeeReceiverUpdated(address oldReceiver, address newReceiver)

setWhitelistedSymmioCore()

Adds or removes a Symmio core diamond from the whitelist. Affiliates can only be registered against whitelisted cores.

Events: WhitelistedSymmioCoreSet(address core, bool status)

setHookAllowedSelectors()

Configures which function selectors an affiliate's hook contracts are allowed to execute via executeForAccount.

Events: HookAllowedSelectorsSet(address affiliate, bytes4[] selectors, bool allowed)

setCallAllowedSelectors()

Configures which function selectors an affiliate can invoke via callAsAffiliate.

Events: CallAllowedSelectorsSet(address affiliate, bytes4[] selectors, bool allowed)

addSymmioCoreToAffiliate()

Adds a whitelisted Symmio core to an active affiliate and registers the affiliate on that core.

Events: SymmioCoreAddedToAffiliate(address affiliate, address core)

Last updated