2024-01-24 15:28:55 +05:30

4.5 KiB

Solidity API

NotImplemented

error NotImplemented()

MalformedCommitmentToMessageLimitMap

error MalformedCommitmentToMessageLimitMap()

isValidCommitmentToMessageLimitMap

function isValidCommitmentToMessageLimitMap(uint256[] commitments, uint256[] limits) internal pure returns (bool)

WakuRln

contractIndex

uint16 contractIndex

constructor

constructor(uint256 _maxMessageLimit, uint16 _contractIndex) public

onlyValidCommitmentToMessageLimitMap

modifier onlyValidCommitmentToMessageLimitMap(uint256[] commitments, uint256[] limits)

_register

function _register(uint256 idCommitment, uint256 userMessageLimit) internal

Registers a member

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member
userMessageLimit uint256 The userMessageLimit of the member

register

function register(uint256[] commitments, uint256[] limits) external

register

function register(uint256 idCommitment, uint256 userMessageLimit) external payable

Allows a user to register as a member

Parameters

Name Type Description
idCommitment uint256 The idCommitment of the member
userMessageLimit uint256 The message limit of the member

_validateRegistration

function _validateRegistration(uint256 idCommitment, uint256 userMessageLimit) internal view

Inheriting contracts MUST override this function

_validateSlash

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

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]

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

InvalidMaxMessageLimit

error InvalidMaxMessageLimit()

WakuRlnRegistry

nextStorageIndex

uint16 nextStorageIndex

storages

mapping(uint16 => address) storages

usingStorageIndex

uint16 usingStorageIndex

NewStorageContract

event NewStorageContract(uint16 index, address storageAddress)

onlyUsableStorage

modifier onlyUsableStorage()

initialize

function initialize() 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(uint256 maxMessageLimit) external

register

function register(uint256[] commitments, uint256[] limits) external

register

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

register

function register(uint16 storageIndex, uint256 idCommitment, uint256 userMessageLimit) external

forceProgress

function forceProgress() external