Skip to content

Commit 8036f2c

Browse files
authored
Merge pull request #36 from threshold-network/auto-update-solidity-api-docs
Update Solidity API docs
2 parents cc016db + 8a83281 commit 8036f2c

File tree

88 files changed

+24180
-23895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+24180
-23895
lines changed

docs/SUMMARY.md

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,89 @@
8080
* [Get Started (PRE Mainnet)](app-development/threshold-access-control-tac/advanced-usage/proxy-re-encryption.md)
8181
* [Contribution Guide](app-development/contribution-guide.md)
8282
* [Staking Contract and DAO](app-development/staking-contract-and-dao/README.md)
83-
* [Random Beacon API](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/index.md)
83+
* [Staking Contract and DAO API](app-development/staking-contract-and-dao/staking-contract-and-dao-api/README.md)
84+
* [BaseTokenholderGovernor](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/BaseTokenholderGovernor.md)
85+
* [Checkpoints](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/Checkpoints.md)
86+
* [GovernorParameters](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/GovernorParameters.md)
87+
* [IApplication](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/staking/IApplication.md)
88+
* [ILegacyTokenStaking](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/staking/ILegacyTokenStaking.md)
89+
* [IStaking](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/staking/IStaking.md)
90+
* [IVotesHistory](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/IVotesHistory.md)
91+
* [KeepStake](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/staking/KeepStake.md)
92+
* [PercentUtils](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/utils/PercentUtils.md)
93+
* [ProxyAdminWithDeputy](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/ProxyAdminWithDeputy.md)
94+
* [SafeTUpgradeable](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/utils/SafeTUpgradeable.md)
95+
* [StakerGovernor](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/StakerGovernor.md)
96+
* [StakerGovernorVotes](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/StakerGovernorVotes.md)
97+
* [T](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/token/T.md)
98+
* [TokenholderGovernor](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/TokenholderGovernor.md)
99+
* [TokenholderGovernorVotes](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/governance/TokenholderGovernorVotes.md)
100+
* [TokenStaking](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/staking/TokenStaking.md)
101+
* [VendingMachine](app-development/staking-contract-and-dao/staking-contract-and-dao-api/generated-docs/vendingVendingMachine.md)
84102
* [Random Beacon](app-development/random-beacon/README.md)
85-
* [Random Beacon API](app-development/random-beacon/random-beacon-api/generated-docs/index.md)
86-
* [TBTCv2](app-development/tbtc-v2/README.md)
87-
* [ECDSA API](app-development/tbtc-v2/ecdsa-api/generated-docs/index.md)
88-
* [TBTCv2 API](app-development/tbtc-v2/tbtc-v2-api/generated-docs/index.md)
103+
* [Random Beacon API](app-development/random-beacon/random-beacon-api/README.md)
104+
* [AltBn128](app-development/random-beacon/random-beacon-api/generated-docs/libraries/AltBn128.md)
105+
* [BeaconAuthorization](app-development/random-beacon/random-beacon-api/generated-docs/libraries/BeaconAuthorization.md)
106+
* [BeaconDkg](app-development/random-beacon/random-beacon-api/generated-docs/libraries/BeaconDkg.md)
107+
* [BeaconDkgValidator](app-development/random-beacon/random-beacon-api/generated-docs/BeaconDkgValidator.md)
108+
* [BeaconInactivity](app-development/random-beacon/random-beacon-api/generated-docs/libraries/BeaconInactivity.md)
109+
* [BLS](app-development/random-beacon/random-beacon-api/generated-docs/libraries/BLS.md)
110+
* [BytesLib](app-development/random-beacon/random-beacon-api/generated-docs/libraries/BytesLib.md)
111+
* [Callback](app-development/random-beacon/random-beacon-api/generated-docs/libraries/Callback.md)
112+
* [Governable](app-development/random-beacon/random-beacon-api/generated-docs/Governable.md)
113+
* [Groups](app-development/random-beacon/random-beacon-api/generated-docs/libraries/Groups.md)
114+
* [IRandomBeacon](app-development/random-beacon/random-beacon-api/generated-docs/api/IRandomBeacon.md)
115+
* [IRandomBeaconConsumer](app-development/random-beacon/random-beacon-api/generated-docs/api/IRandomBeaconConsumer.md)
116+
* [ModUtils](app-development/random-beacon/random-beacon-api/generated-docs/libraries/ModUtils.md)
117+
* [RandomBeacon](app-development/random-beacon/random-beacon-api/generated-docs/RandomBeacon.md)
118+
* [RandomBeaconChaosnet](app-development/random-beacon/random-beacon-api/generated-docs/RandomBeaconChaosnet.md)
119+
* [RandomBeaconGovernance](app-development/random-beacon/random-beacon-api/generated-docs/RandomBeaconGovernance.md)
120+
* [Reimbursable](app-development/random-beacon/random-beacon-api/generated-docs/Reimbursable.md)
121+
* [ReimbursementPool](app-development/random-beacon/random-beacon-api/generated-docs/ReimbursementPool.md)
122+
* [Relay](app-development/random-beacon/random-beacon-api/generated-docs/libraries/Relay.md)
123+
* [tBTC](app-development/tbtc-v2/README.md)
124+
* [ECDSA API](app-development/tbtc-v2/ecdsa-api/README.md)
125+
* [EcdsaAuthorization](app-development/tbtc-v2/ecdsa-api/generated-docs/libraries/EcdsaAuthorization.md)
126+
* [EcdsaDkg](app-development/tbtc-v2/ecdsa-api/generated-docs/libraries/EcdsaDkg.md)
127+
* [EcdsaDkgValidator](app-development/tbtc-v2/ecdsa-api/generated-docs/EcdsaDkgValidator.md)
128+
* [EcdsaInactivity](app-development/tbtc-v2/ecdsa-api/generated-docs/libraries/EcdsaInactivity.md)
129+
* [IWalletOwner](app-development/tbtc-v2/ecdsa-api/generated-docs/api/IWalletOwner.md)
130+
* [IWalletRegistry](app-development/tbtc-v2/ecdsa-api/generated-docs/api/IWalletRegistry.md)
131+
* [WalletRegistry](app-development/tbtc-v2/ecdsa-api/generated-docs/WalletRegistry.md)
132+
* [WalletRegistryGovernance](app-development/tbtc-v2/ecdsa-api/generated-docs/WalletRegistryGovernance.md)
133+
* [Wallets](app-development/tbtc-v2/ecdsa-api/generated-docs/libraries/Wallets.md)
134+
* [Bridge API](app-development/tbtc-v2/tbtc-v2-api/README.md)
135+
* [Bank](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bank/Bank.md)
136+
* [BitcoinTx](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/BitcoinTx.md)
137+
* [Bridge](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Bridge.md)
138+
* [BridgeGovernance](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/BridgeGovernance.md)
139+
* [BridgeGovernanceParameters](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/BridgeGovernanceParameters.md)
140+
* [BridgeState](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/BridgeState.md)
141+
* [Deposit](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Deposit.md)
142+
* [DepositSweep](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/DepositSweep.md)
143+
* [DonationVault](app-development/tbtc-v2/tbtc-v2-api/generated-docs/vault/DonationVault.md)
144+
* [EcdsaLib](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/EcdsaLib.md)
145+
* [Fraud](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Fraud.md)
146+
* [GovernanceUtils](app-development/tbtc-v2/tbtc-v2-api/generated-docs/GovernanceUtils.md)
147+
* [Heartbeat](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Heartbeat.md)
148+
* [IReceiveBalanceApproval](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bank/IReceiveBalanceApproval.md)
149+
* [IRelay](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/IRelay.md)
150+
* [IVault](app-development/tbtc-v2/tbtc-v2-api/generated-docs/vault/IVault.md)
151+
* [L2TBTC](app-development/tbtc-v2/tbtc-v2-api/generated-docs/l2/L2TBTC.md)
152+
* [L2WormholeGateway](app-development/tbtc-v2/tbtc-v2-api/generated-docs/l2/L2WormholeGateway.md)
153+
* [LightRelay](app-development/tbtc-v2/tbtc-v2-api/generated-docs/relay/LightRelay.md)
154+
* [LightRelayMaintainerProxy](app-development/tbtc-v2/tbtc-v2-api/generated-docs/relay/LightRelayMaintainerProxy.md)
155+
* [MaintainerProxy](app-development/tbtc-v2/tbtc-v2-api/generated-docs/maintainer/MaintainerProxy.md)
156+
* [MovingFunds](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/MovingFunds.md)
157+
* [Redemption](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Redemption.md)
158+
* [TBTC](app-development/tbtc-v2/tbtc-v2-api/generated-docs/token/TBTC.md)
159+
* [TBTCOptimisticMinting](app-development/tbtc-v2/tbtc-v2-api/generated-docs/vault/TBTCOptimisticMinting.md)
160+
* [TBTCVault](app-development/tbtc-v2/tbtc-v2-api/generated-docs/vault/TBTCVault.md)
161+
* [VendingMachine](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/VendingMachine.md)
162+
* [VendingMachineV2](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/VendingMachineV2.md)
163+
* [VendingMachineV3](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/VendingMachineV3.md)
164+
* [WalletCoordinator](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/WalletCoordinator.md)
165+
* [Wallets](app-development/tbtc-v2/tbtc-v2-api/generated-docs/bridge/Wallets.md)
89166

90167
## Resources
91168

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Random Beacon API
2+
3+
You can learn about APIs of contracts related to the Random Beacon under the
4+
following links:
5+
6+
[AltBn128](./generated-docs/libraries/AltBn128.md)
7+
8+
[BeaconAuthorization](./generated-docs/libraries/BeaconAuthorization.md)
9+
10+
[BeaconDkg](./generated-docs/libraries/BeaconDkg.md)
11+
12+
[BeaconDkgValidator](./generated-docs/BeaconDkgValidator.md)
13+
14+
[BeaconInactivity](./generated-docs/libraries/BeaconInactivity.md)
15+
16+
[BLS](./generated-docs/libraries/BLS.md)
17+
18+
[BytesLib](./generated-docs/libraries/BytesLib.md)
19+
20+
[Callback](./generated-docs/libraries/Callback.md)
21+
22+
[Governable](./generated-docs/Governable.md)
23+
24+
[Groups](./generated-docs/libraries/Groups.md)
25+
26+
[IRandomBeacon](./generated-docs/api/IRandomBeacon.md)
27+
28+
[IRandomBeaconConsumer](./generated-docs/api/IRandomBeaconConsumer.md)
29+
30+
[ModUtils](./generated-docs/libraries/ModUtils.md)
31+
32+
[RandomBeacon](./generated-docs/RandomBeacon.md)
33+
34+
[RandomBeaconChaosnet](./generated-docs/RandomBeaconChaosnet.md)
35+
36+
[RandomBeaconGovernance](./generated-docs/RandomBeaconGovernance.md)
37+
38+
[Reimbursable](./generated-docs/Reimbursable.md)
39+
40+
[ReimbursementPool](./generated-docs/ReimbursementPool.md)
41+
42+
[Relay](./generated-docs/libraries/Relay.md)
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Solidity API
2+
3+
## BeaconDkgValidator
4+
5+
DKGValidator allows performing a full validation of DKG result,
6+
including checking the format of fields in the result, declared
7+
selected group members, and signatures of operators supporting the
8+
result. The operator submitting the result should perform the
9+
validation using a free contract call before submitting the result
10+
to ensure their result is valid and can not be challenged. All other
11+
network operators should perform validation of the submitted result
12+
using a free contract call and challenge the result if the
13+
validation fails.
14+
15+
### groupSize
16+
17+
```solidity
18+
uint256 groupSize
19+
```
20+
21+
Size of a group in the threshold relay.
22+
23+
### groupThreshold
24+
25+
```solidity
26+
uint256 groupThreshold
27+
```
28+
29+
The minimum number of group members needed to interact according to
30+
the protocol to produce a relay entry. The adversary can not learn
31+
anything about the key as long as it does not break into
32+
groupThreshold+1 of members.
33+
34+
### activeThreshold
35+
36+
```solidity
37+
uint256 activeThreshold
38+
```
39+
40+
The minimum number of active and properly behaving group members
41+
during the DKG needed to accept the result. This number is higher
42+
than `groupThreshold` to keep a safety margin for members becoming
43+
inactive after DKG so that the group can still produce a relay
44+
entry.
45+
46+
### signatureByteSize
47+
48+
```solidity
49+
uint256 signatureByteSize
50+
```
51+
52+
Size in bytes of a single signature produced by operator supporting
53+
DKG result.
54+
55+
### sortitionPool
56+
57+
```solidity
58+
contract SortitionPool sortitionPool
59+
```
60+
61+
### constructor
62+
63+
```solidity
64+
constructor(contract SortitionPool _sortitionPool) public
65+
```
66+
67+
### validate
68+
69+
```solidity
70+
function validate(struct BeaconDkg.Result result, uint256 seed, uint256 startBlock) external view returns (bool isValid, string errorMsg)
71+
```
72+
73+
Performs a full validation of DKG result, including checking the
74+
format of fields in the result, declared selected group members,
75+
and signatures of operators supporting the result.
76+
77+
#### Parameters
78+
79+
| Name | Type | Description |
80+
| ---- | ---- | ----------- |
81+
| result | struct BeaconDkg.Result | |
82+
| seed | uint256 | seed used to start the DKG and select group members |
83+
| startBlock | uint256 | DKG start block |
84+
85+
#### Return Values
86+
87+
| Name | Type | Description |
88+
| ---- | ---- | ----------- |
89+
| isValid | bool | true if the result is valid, false otherwise |
90+
| errorMsg | string | validation error message; empty for a valid result |
91+
92+
### validateFields
93+
94+
```solidity
95+
function validateFields(struct BeaconDkg.Result result) public pure returns (bool isValid, string errorMsg)
96+
```
97+
98+
Performs a static validation of DKG result fields: lengths,
99+
ranges, and order of arrays.
100+
101+
#### Return Values
102+
103+
| Name | Type | Description |
104+
| ---- | ---- | ----------- |
105+
| isValid | bool | true if the result is valid, false otherwise |
106+
| errorMsg | string | validation error message; empty for a valid result |
107+
108+
### validateGroupMembers
109+
110+
```solidity
111+
function validateGroupMembers(struct BeaconDkg.Result result, uint256 seed) public view returns (bool)
112+
```
113+
114+
Performs validation of group members as declared in DKG
115+
result against group members selected by the sortition pool.
116+
117+
#### Parameters
118+
119+
| Name | Type | Description |
120+
| ---- | ---- | ----------- |
121+
| result | struct BeaconDkg.Result | |
122+
| seed | uint256 | seed used to start the DKG and select group members |
123+
124+
#### Return Values
125+
126+
| Name | Type | Description |
127+
| ---- | ---- | ----------- |
128+
| [0] | bool | true if group members matches; false otherwise |
129+
130+
### validateSignatures
131+
132+
```solidity
133+
function validateSignatures(struct BeaconDkg.Result result, uint256 startBlock) public view returns (bool)
134+
```
135+
136+
Performs validation of signatures supplied in DKG result.
137+
Note that this function does not check if addresses which
138+
supplied signatures supporting the result are the ones selected
139+
to the group by sortition pool. This function should be used
140+
together with `validateGroupMembers`.
141+
142+
#### Parameters
143+
144+
| Name | Type | Description |
145+
| ---- | ---- | ----------- |
146+
| result | struct BeaconDkg.Result | |
147+
| startBlock | uint256 | DKG start block |
148+
149+
#### Return Values
150+
151+
| Name | Type | Description |
152+
| ---- | ---- | ----------- |
153+
| [0] | bool | true if group members matches; false otherwise |
154+
155+
### validateMembersHash
156+
157+
```solidity
158+
function validateMembersHash(struct BeaconDkg.Result result) public pure returns (bool)
159+
```
160+
161+
Performs validation of hashed group members that actively took
162+
part in DKG.
163+
164+
#### Parameters
165+
166+
| Name | Type | Description |
167+
| ---- | ---- | ----------- |
168+
| result | struct BeaconDkg.Result | DKG result |
169+
170+
#### Return Values
171+
172+
| Name | Type | Description |
173+
| ---- | ---- | ----------- |
174+
| [0] | bool | true if result's group members hash matches with the one that is challenged. |
175+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Solidity API
2+
3+
## Governable
4+
5+
Governable contract.
6+
7+
A constructor is not defined, which makes the contract compatible with
8+
upgradable proxies. This requires calling explicitly `_transferGovernance`
9+
function in a child contract.
10+
11+
### governance
12+
13+
```solidity
14+
address governance
15+
```
16+
17+
### GovernanceTransferred
18+
19+
```solidity
20+
event GovernanceTransferred(address oldGovernance, address newGovernance)
21+
```
22+
23+
### onlyGovernance
24+
25+
```solidity
26+
modifier onlyGovernance()
27+
```
28+
29+
### transferGovernance
30+
31+
```solidity
32+
function transferGovernance(address newGovernance) external virtual
33+
```
34+
35+
Transfers governance of the contract to `newGovernance`.
36+
37+
### _transferGovernance
38+
39+
```solidity
40+
function _transferGovernance(address newGovernance) internal virtual
41+
```
42+

0 commit comments

Comments
 (0)