OperatorLib

Git Source

Functions

grantOperatorPermissions

Grants permission to a given operator for a character.

function grantOperatorPermissions(uint256 characterId, address operator, uint256 permissionBitMap) external;

Parameters

NameTypeDescription
characterIduint256The ID of the character to set operator for.
operatoraddressThe operator address to set.
permissionBitMapuint256The permission bitmap for the operator.

grantOperators4Note

Sets blocklist and allowlist for a specific note. Blocklist and allowlist are overwritten every time.

function grantOperators4Note(
    uint256 characterId,
    uint256 noteId,
    address[] calldata blocklist,
    address[] calldata allowlist
) external;

Parameters

NameTypeDescription
characterIduint256The character ID of the note owner.
noteIduint256The note ID to grant.
blocklistaddress[]The addresses list of blocked operators.
allowlistaddress[]The addresses list of allowed operators.

clearOperators

function clearOperators(uint256 characterId) external;

_clearOperators4Note

function _clearOperators4Note(DataTypes.Operators4Note storage operators4Note) internal;

_updateOperators4Note

function _updateOperators4Note(
    DataTypes.Operators4Note storage operators4Note,
    address[] calldata blocklist,
    address[] calldata allowlist
) internal;

_bitmapFilter

_bitmapFilter unsets bits of non-existent permission IDs to zero.
These unset permission IDs are meaningless now, but they are reserved for future use, so it's best to leave them blank and avoid messing up with future methods.

function _bitmapFilter(uint256 bitmap) internal pure returns (uint256);