204 lines
3.3 KiB
Markdown
Raw Normal View History

2023-03-30 12:21:48 +05:30
# Solidity API
2023-07-31 10:51:15 +05:30
## NotImplemented
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
error NotImplemented()
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
## WakuRln
2023-03-30 12:21:48 +05:30
### contractIndex
```solidity
uint16 contractIndex
```
2023-07-31 10:51:15 +05:30
### constructor
2023-03-30 12:21:48 +05:30
```solidity
constructor(address _poseidonHasher, uint16 _contractIndex) public
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
### \_register
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
function _register(uint256 idCommitment) internal
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
Registers a member
2023-03-30 12:21:48 +05:30
#### Parameters
2023-07-31 10:51:15 +05:30
| Name | Type | Description |
| ------------ | ------- | ------------------------------ |
| idCommitment | uint256 | The idCommitment of the member |
2023-03-30 12:21:48 +05:30
2023-07-31 10:51:15 +05:30
### register
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
function register(uint256[] idCommitments) external
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
### register
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
function register(uint256 idCommitment) external payable
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
Allows a user to register as a member
2023-03-30 12:21:48 +05:30
#### Parameters
2023-07-31 10:51:15 +05:30
| Name | Type | Description |
| ------------ | ------- | ------------------------------ |
2023-07-03 18:17:34 +05:30
| idCommitment | uint256 | The idCommitment of the member |
2023-03-30 12:21:48 +05:30
2023-07-31 10:51:15 +05:30
### slash
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
function slash(uint256 idCommitment, address payable receiver, uint256[8] proof) external pure
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
_Allows a user to slash a member_
2023-03-30 12:21:48 +05:30
#### Parameters
2023-07-31 10:51:15 +05:30
| Name | Type | Description |
| ------------ | --------------- | ------------------------------ |
| idCommitment | uint256 | The idCommitment of the member |
| receiver | address payable | |
| proof | uint256[8] | |
2023-03-30 12:21:48 +05:30
2023-07-31 10:51:15 +05:30
### \_validateRegistration
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
function _validateRegistration(uint256 idCommitment) internal view
2023-03-30 12:21:48 +05:30
```
2023-07-31 10:51:15 +05:30
_Inheriting contracts MUST override this function_
2023-03-30 12:21:48 +05:30
2023-07-31 10:51:15 +05:30
### \_validateSlash
2023-07-03 18:17:34 +05:30
2023-07-31 10:51:15 +05:30
```solidity
function _validateSlash(uint256 idCommitment, address payable receiver, uint256[8] proof) internal pure
```
2023-08-02 10:54:59 +05:30
### withdraw
```solidity
function withdraw() external pure
```
Allows a user to withdraw funds allocated to them upon slashing a member
## StorageAlreadyExists
```solidity
error StorageAlreadyExists(address storageAddress)
```
## NoStorageContractAvailable
```solidity
error NoStorageContractAvailable()
```
2023-08-03 18:25:13 +05:30
## IncompatibleStorage
```solidity
2023-08-03 18:25:13 +05:30
error IncompatibleStorage()
```
## IncompatibleStorageIndex
```solidity
error IncompatibleStorageIndex()
```
## WakuRlnRegistry
2023-08-03 17:20:25 +05:30
### nextStorageIndex
```solidity
2023-08-03 17:20:25 +05:30
uint16 nextStorageIndex
```
### storages
```solidity
mapping(uint16 => address) storages
```
### usingStorageIndex
```solidity
uint16 usingStorageIndex
```
### poseidonHasher
```solidity
contract IPoseidonHasher poseidonHasher
```
### NewStorageContract
```solidity
event NewStorageContract(uint16 index, address storageAddress)
```
2023-08-08 16:10:06 +05:30
### onlyUsableStorage
```solidity
modifier onlyUsableStorage()
```
### constructor
```solidity
constructor(address _poseidonHasher) public
```
### \_insertIntoStorageMap
```solidity
function _insertIntoStorageMap(address storageAddress) internal
```
### registerStorage
```solidity
function registerStorage(address storageAddress) external
```
### newStorage
```solidity
function newStorage() external
```
### register
```solidity
2023-08-03 18:25:13 +05:30
function register(uint256[] commitments) external payable
```
2023-08-08 13:32:07 +05:30
### register
```solidity
function register(uint16 storageIndex, uint256[] commitments) external payable
```
### register
```solidity
function register(uint16 storageIndex, uint256 commitment) external payable
```
2023-08-03 18:25:13 +05:30
### forceProgress
```solidity
function forceProgress() external
```