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

eip712Domain

function eip712Domain() external view returns (bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions)

See IERC-5267.

Returns

NameTypeDescription
fieldsbytes1
namestring
versionstring
chainIduint256
verifyingContractaddress
saltbytes32
extensionsuint256[]

increaseNonce

function increaseNonce(address where) external nonpayable

Increase the nonce of a given "who" to a particular "where" entity.

It can be used to invalidate a given signature.

Parameters

NameTypeDescription
whereaddressaddress of the "where" entity

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" entity

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" entity
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

nonces

function nonces(address who, address where) external view returns (uint256 nonce)

Get the nonce of a given "who" to a particular "where" entity.

Parameters

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

Returns

NameTypeDescription
nonceuint256nonce

optIn

function optIn(address where) external nonpayable

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

Parameters

NameTypeDescription
whereaddressaddress of the "where" entity

optIn

function optIn(address who, address where, uint48 deadline, bytes signature) external nonpayable

Opt-in a "who" to a particular "where" entity with a signature.

Parameters

NameTypeDescription
whoaddressaddress of the "who"
whereaddressaddress of the "where" entity
deadlineuint48time point until the signature is valid (inclusively)
signaturebytessignature of the "who"

optOut

function optOut(address who, address where, uint48 deadline, bytes signature) external nonpayable

Opt-out a "who" from a particular "where" entity with a signature.

Parameters

NameTypeDescription
whoaddressaddress of the "who"
whereaddressaddress of the "where" entity
deadlineuint48time point until the signature is valid (inclusively)
signaturebytessignature of the "who"

optOut

function optOut(address where) external nonpayable

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

Parameters

NameTypeDescription
whereaddressaddress of the "where" entity

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

IncreaseNonce

event IncreaseNonce(address indexed who, address indexed where)

Emitted when the nonce of a "who" to a "where" entity is increased.

Parameters

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

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