Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ROFLable

Git Source

Title: Base contract for ROFL-authenticated access control

Provides the onlyROFL modifier, restricting calls to transactions signed by an authorized instance of a specific ROFL app. See ROFLableUpgradeable for an upgradeable counterpart of this contract.

Example

contract MyContract is ROFLable {
constructor(bytes21 inRoflAppId) ROFLable(inRoflAppId) {}
function setPrice(uint128 price) external onlyROFL {
...
}
}

State Variables

_roflAppId

bytes21 private _roflAppId

Functions

constructor

Initializes the contract, authorizing the given ROFL app.

constructor(bytes21 initialRoflAppId) ;

Parameters

NameTypeDescription
initialRoflAppIdbytes21ROFL app ID.

onlyROFL

Reverts unless the transaction is signed by an authorized instance of the configured ROFL app.

modifier onlyROFL() ;

roflAppId

Returns the currently authorized ROFL app ID.

function roflAppId() public view virtual returns (bytes21);

setRoflAppId

Updates the authorized ROFL app ID. Callable only by the currently authorized ROFL app.

function setRoflAppId(bytes21 newRoflAppId) public virtual onlyROFL;

_checkRoflAppId

Reverts unless the transaction is signed by an authorized instance of the configured ROFL app.

function _checkRoflAppId() internal view virtual;

_setRoflAppId

Updates the authorized ROFL app ID. Internal, without access restriction - gate calls to this with your own access control (e.g. onlyOwner) when exposing it externally.

function _setRoflAppId(bytes21 newRoflAppId) internal virtual;

Events

RoflAppIdUpdated

event RoflAppIdUpdated(bytes21 indexed previousRoflAppId, bytes21 indexed newRoflAppId);