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

ROFLableUpgradeable

Git Source

Inherits: Initializable

Title: Upgradeable base contract for ROFL-authenticated access control

Upgradeable counterpart of ROFLable. Provides the onlyROFL modifier, restricting calls to transactions signed by an authorized instance of a specific ROFL app.

Example

contract MyContract is ROFLableUpgradeable {
function initialize(bytes21 inRoflAppId) public initializer {
__ROFLable_init(inRoflAppId);
}
function setPrice(uint128 price) external onlyROFL {
...
}
}

Constants

ROFLableStorageLocation

bytes32 private constant ROFLableStorageLocation =
    0x8940e4963ccaa2197d6e961909d33623c50bf1e108e975034323ec0eeeb65700

Functions

_getROFLableStorage

function _getROFLableStorage() private pure returns (ROFLableStorage storage $);

__ROFLable_init

Initializes the contract, authorizing the given ROFL app.

function __ROFLable_init(bytes21 initialRoflAppId) internal onlyInitializing;

Parameters

NameTypeDescription
initialRoflAppIdbytes21ROFL app ID.

__ROFLable_init_unchained

function __ROFLable_init_unchained(bytes21 initialRoflAppId) internal onlyInitializing;

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);

Structs

ROFLableStorage

Note: storage-location: erc7201:oasisprotocol.storage.ROFLable

struct ROFLableStorage {
    bytes21 _roflAppId;
}