-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from threshold-network/auto-update-solidity-ap…
…i-docs Update Solidity API docs
- Loading branch information
Showing
88 changed files
with
24,180 additions
and
23,895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
docs/app-development/random-beacon/random-beacon-api/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Random Beacon API | ||
|
||
You can learn about APIs of contracts related to the Random Beacon under the | ||
following links: | ||
|
||
[AltBn128](./generated-docs/libraries/AltBn128.md) | ||
|
||
[BeaconAuthorization](./generated-docs/libraries/BeaconAuthorization.md) | ||
|
||
[BeaconDkg](./generated-docs/libraries/BeaconDkg.md) | ||
|
||
[BeaconDkgValidator](./generated-docs/BeaconDkgValidator.md) | ||
|
||
[BeaconInactivity](./generated-docs/libraries/BeaconInactivity.md) | ||
|
||
[BLS](./generated-docs/libraries/BLS.md) | ||
|
||
[BytesLib](./generated-docs/libraries/BytesLib.md) | ||
|
||
[Callback](./generated-docs/libraries/Callback.md) | ||
|
||
[Governable](./generated-docs/Governable.md) | ||
|
||
[Groups](./generated-docs/libraries/Groups.md) | ||
|
||
[IRandomBeacon](./generated-docs/api/IRandomBeacon.md) | ||
|
||
[IRandomBeaconConsumer](./generated-docs/api/IRandomBeaconConsumer.md) | ||
|
||
[ModUtils](./generated-docs/libraries/ModUtils.md) | ||
|
||
[RandomBeacon](./generated-docs/RandomBeacon.md) | ||
|
||
[RandomBeaconChaosnet](./generated-docs/RandomBeaconChaosnet.md) | ||
|
||
[RandomBeaconGovernance](./generated-docs/RandomBeaconGovernance.md) | ||
|
||
[Reimbursable](./generated-docs/Reimbursable.md) | ||
|
||
[ReimbursementPool](./generated-docs/ReimbursementPool.md) | ||
|
||
[Relay](./generated-docs/libraries/Relay.md) |
175 changes: 175 additions & 0 deletions
175
...evelopment/random-beacon/random-beacon-api/generated-docs/BeaconDkgValidator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
# Solidity API | ||
|
||
## BeaconDkgValidator | ||
|
||
DKGValidator allows performing a full validation of DKG result, | ||
including checking the format of fields in the result, declared | ||
selected group members, and signatures of operators supporting the | ||
result. The operator submitting the result should perform the | ||
validation using a free contract call before submitting the result | ||
to ensure their result is valid and can not be challenged. All other | ||
network operators should perform validation of the submitted result | ||
using a free contract call and challenge the result if the | ||
validation fails. | ||
|
||
### groupSize | ||
|
||
```solidity | ||
uint256 groupSize | ||
``` | ||
|
||
Size of a group in the threshold relay. | ||
|
||
### groupThreshold | ||
|
||
```solidity | ||
uint256 groupThreshold | ||
``` | ||
|
||
The minimum number of group members needed to interact according to | ||
the protocol to produce a relay entry. The adversary can not learn | ||
anything about the key as long as it does not break into | ||
groupThreshold+1 of members. | ||
|
||
### activeThreshold | ||
|
||
```solidity | ||
uint256 activeThreshold | ||
``` | ||
|
||
The minimum number of active and properly behaving group members | ||
during the DKG needed to accept the result. This number is higher | ||
than `groupThreshold` to keep a safety margin for members becoming | ||
inactive after DKG so that the group can still produce a relay | ||
entry. | ||
|
||
### signatureByteSize | ||
|
||
```solidity | ||
uint256 signatureByteSize | ||
``` | ||
|
||
Size in bytes of a single signature produced by operator supporting | ||
DKG result. | ||
|
||
### sortitionPool | ||
|
||
```solidity | ||
contract SortitionPool sortitionPool | ||
``` | ||
|
||
### constructor | ||
|
||
```solidity | ||
constructor(contract SortitionPool _sortitionPool) public | ||
``` | ||
|
||
### validate | ||
|
||
```solidity | ||
function validate(struct BeaconDkg.Result result, uint256 seed, uint256 startBlock) external view returns (bool isValid, string errorMsg) | ||
``` | ||
|
||
Performs a full validation of DKG result, including checking the | ||
format of fields in the result, declared selected group members, | ||
and signatures of operators supporting the result. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| result | struct BeaconDkg.Result | | | ||
| seed | uint256 | seed used to start the DKG and select group members | | ||
| startBlock | uint256 | DKG start block | | ||
|
||
#### Return Values | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| isValid | bool | true if the result is valid, false otherwise | | ||
| errorMsg | string | validation error message; empty for a valid result | | ||
|
||
### validateFields | ||
|
||
```solidity | ||
function validateFields(struct BeaconDkg.Result result) public pure returns (bool isValid, string errorMsg) | ||
``` | ||
|
||
Performs a static validation of DKG result fields: lengths, | ||
ranges, and order of arrays. | ||
|
||
#### Return Values | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| isValid | bool | true if the result is valid, false otherwise | | ||
| errorMsg | string | validation error message; empty for a valid result | | ||
|
||
### validateGroupMembers | ||
|
||
```solidity | ||
function validateGroupMembers(struct BeaconDkg.Result result, uint256 seed) public view returns (bool) | ||
``` | ||
|
||
Performs validation of group members as declared in DKG | ||
result against group members selected by the sortition pool. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| result | struct BeaconDkg.Result | | | ||
| seed | uint256 | seed used to start the DKG and select group members | | ||
|
||
#### Return Values | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| [0] | bool | true if group members matches; false otherwise | | ||
|
||
### validateSignatures | ||
|
||
```solidity | ||
function validateSignatures(struct BeaconDkg.Result result, uint256 startBlock) public view returns (bool) | ||
``` | ||
|
||
Performs validation of signatures supplied in DKG result. | ||
Note that this function does not check if addresses which | ||
supplied signatures supporting the result are the ones selected | ||
to the group by sortition pool. This function should be used | ||
together with `validateGroupMembers`. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| result | struct BeaconDkg.Result | | | ||
| startBlock | uint256 | DKG start block | | ||
|
||
#### Return Values | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| [0] | bool | true if group members matches; false otherwise | | ||
|
||
### validateMembersHash | ||
|
||
```solidity | ||
function validateMembersHash(struct BeaconDkg.Result result) public pure returns (bool) | ||
``` | ||
|
||
Performs validation of hashed group members that actively took | ||
part in DKG. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| result | struct BeaconDkg.Result | DKG result | | ||
|
||
#### Return Values | ||
|
||
| Name | Type | Description | | ||
| ---- | ---- | ----------- | | ||
| [0] | bool | true if result's group members hash matches with the one that is challenged. | | ||
|
42 changes: 42 additions & 0 deletions
42
docs/app-development/random-beacon/random-beacon-api/generated-docs/Governable.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Solidity API | ||
|
||
## Governable | ||
|
||
Governable contract. | ||
|
||
A constructor is not defined, which makes the contract compatible with | ||
upgradable proxies. This requires calling explicitly `_transferGovernance` | ||
function in a child contract. | ||
|
||
### governance | ||
|
||
```solidity | ||
address governance | ||
``` | ||
|
||
### GovernanceTransferred | ||
|
||
```solidity | ||
event GovernanceTransferred(address oldGovernance, address newGovernance) | ||
``` | ||
|
||
### onlyGovernance | ||
|
||
```solidity | ||
modifier onlyGovernance() | ||
``` | ||
|
||
### transferGovernance | ||
|
||
```solidity | ||
function transferGovernance(address newGovernance) external virtual | ||
``` | ||
|
||
Transfers governance of the contract to `newGovernance`. | ||
|
||
### _transferGovernance | ||
|
||
```solidity | ||
function _transferGovernance(address newGovernance) internal virtual | ||
``` | ||
|
Oops, something went wrong.