80 lines
1.7 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
2023-07-31 10:51:15 +05:30
### constructor
2023-03-30 12:21:48 +05:30
```solidity
2023-07-31 10:51:15 +05:30
constructor(address _poseidonHasher) 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
```