2024-04-22 14:33:22 -04:00

5.2 KiB

Solidity API

NotImplemented

error NotImplemented()

InvalidIdCommitmentIndex

error InvalidIdCommitmentIndex(uint256 idCommitment, uint256 index)

MembershipStillActive

error MembershipStillActive(uint256 idCommitment)

WakuRln

contractIndex

uint16 contractIndex

MEMBERSHIP_TTL

uint40 MEMBERSHIP_TTL

The default TTL period in seconds for a membership

membershipExpiry

mapping(uint256 => uint40) membershipExpiry

The expiry timestamp of a membership maps from idCommitment to a timestamp

constructor

constructor(address _poseidonHasher, uint16 _contractIndex, uint40 _ttl) public

_setCommitment

function _setCommitment(uint256 idCommitment, uint256 index) internal

_register

function _register(uint256 idCommitment) internal

Registers a member

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member

register

function register(uint256[] idCommitments) external

registerAtIndex

function registerAtIndex(uint256 idCommitment, uint256 index) external

Register a member at specific index

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member
index uint256 The index in which to register the member

renew

function renew(uint256 idCommitment) external

Renew membership credentials

register

function register(uint256 idCommitment) external payable

Allows a user to register as a member

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member

slash

function slash(uint256 idCommitment, address payable receiver, uint256[8] proof) external pure

Allows a user to slash a member

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member
receiver address payable
proof uint256[8]

_validateRegistration

function _validateRegistration(uint256 idCommitment) internal view

Inheriting contracts MUST override this function

_validateIndexExpiration

function _validateIndexExpiration(uint256 idCommitment, uint256 index) internal view

_validateSlash

function _validateSlash(uint256 idCommitment, address payable receiver, uint256[8] proof) internal pure

withdraw

function withdraw() external pure

Allows a user to withdraw funds allocated to them upon slashing a member

StorageAlreadyExists

error StorageAlreadyExists(address storageAddress)

NoStorageContractAvailable

error NoStorageContractAvailable()

IncompatibleStorage

error IncompatibleStorage()

IncompatibleStorageIndex

error IncompatibleStorageIndex()

WakuRlnRegistry

nextStorageIndex

uint16 nextStorageIndex

storages

mapping(uint16 => address) storages

usingStorageIndex

uint16 usingStorageIndex

poseidonHasher

contract IPoseidonHasher poseidonHasher

membershipTTL

uint40 membershipTTL

NewStorageContract

event NewStorageContract(uint16 index, address storageAddress)

onlyUsableStorage

modifier onlyUsableStorage()

initialize

function initialize(address _poseidonHasher, uint40 _membershipTTL) external

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

_Function that should revert when msg.sender is not authorized to upgrade the contract. Called by {upgradeTo} and {upgradeToAndCall}.

Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.

function _authorizeUpgrade(address) internal override onlyOwner {}
```_

### _insertIntoStorageMap

```solidity
function _insertIntoStorageMap(address storageAddress) internal

registerStorage

function registerStorage(address storageAddress) external

newStorage

function newStorage() external

register

function register(uint256[] commitments) external

register

function register(uint16 storageIndex, uint256[] commitments) external

register

function register(uint16 storageIndex, uint256 commitment) external

registerAtIndex

function registerAtIndex(uint16 storageIndex, uint256 commitment, uint256 index) external

forceProgress

function forceProgress() external