Skip to main content

OptInService

Git Source

Methods

WHERE_REGISTRY

function WHERE_REGISTRY() external view returns (address)

Get the address of the registry where to opt-in.

Returns

NameTypeDescription
addressaddress of the "where" registry

WHO_REGISTRY

function WHO_REGISTRY() external view returns (address)

Get the "who" registry's address.

Returns

NameTypeDescription
addressaddress of the "who" registry

isOptedIn

function isOptedIn(address who, address where) external view returns (bool)

Check if a given "who" is opted-in to a particular "where" entity.

Parameters

NameTypeDescription
whoaddressaddress of the "who"
whereaddressaddress of the "where" registry

Returns

NameTypeDescription
boolif the "who" is opted-in

isOptedInAt

function isOptedInAt(address who, address where, uint48 timestamp, bytes hint) external view returns (bool)

Get if a given "who" is opted-in to a particular "where" entity at a given timestamp using a hint.

Parameters

NameTypeDescription
whoaddressaddress of the "who"
whereaddressaddress of the "where" registry
timestampuint48time point to get if the "who" is opted-in at
hintbyteshint for the checkpoint index

Returns

NameTypeDescription
boolif the "who" is opted-in at the given timestamp

optIn

function optIn(address where) external nonpayable

Opt-in a calling "who" to a particular "where" entity.

Parameters

NameTypeDescription
whereaddressaddress of the "where" registry

optOut

function optOut(address where) external nonpayable

Opt-out a calling "who" from a particular "where" entity.

Parameters

NameTypeDescription
whereaddressaddress of the "where" registry

staticDelegateCall

function staticDelegateCall(address target, bytes data) external nonpayable

Make a delegatecall from this contract to a given target contract with a particular data (always reverts with a return data).

It allows to use this contract's storage on-chain.

Parameters

NameTypeDescription
targetaddressaddress of the contract to make a delegatecall to
databytesdata to make a delegatecall with

Events

OptIn

event OptIn(address indexed who, address indexed where)

Emitted when a "who" opts into a "where" entity.

Parameters

NameTypeDescription
who indexedaddressaddress of the "who"
where indexedaddressaddress of the "where" entity

OptOut

event OptOut(address indexed who, address indexed where)

Emitted when a "who" opts out from a "where" entity.

Parameters

NameTypeDescription
who indexedaddressaddress of the "who"
where indexedaddressaddress of the "where" entity