Skip to content

Commit dcd9928

Browse files
committed
Updating docs
1 parent 081e9e5 commit dcd9928

12 files changed

Lines changed: 71 additions & 18 deletions

File tree

docs/contracts/AppRegistry.sol/contract.AppRegistry.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AppRegistry
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/AppRegistry.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/AppRegistry.sol)
33

44
**Inherits:**
55
[Locker](/src/Locker.sol/abstract.Locker.md), [ISlash](/src/interfaces/ISlash.sol/interface.ISlash.md), AccessControl
@@ -18,6 +18,10 @@ No collateral weight for parameter administration — this registry is purely fo
1818
collateral management and slashing. See NodeRegistry for the parameter-administration-enabled
1919
variant used by node operators.
2020
Slashing can occur in both Locked and Unlocking states.
21+
Adjudicators are not economically incentivised by slash outcomes by design.
22+
Dispute initiators pay the adjudicator's handling fee off-chain (similar to
23+
arbitration forums / ODRP). This avoids creating perverse incentives around
24+
decision outcomes.
2125

2226

2327
## State Variables
@@ -29,7 +33,7 @@ bytes32 public constant ADJUDICATOR_ROLE = keccak256("ADJUDICATOR_ROLE")
2933

3034

3135
### slashCooldown
32-
Minimum time (seconds) that must elapse between any two slash calls.
36+
Minimum time (seconds) that must elapse between consecutive slashes by the same adjudicator.
3337

3438

3539
```solidity
@@ -38,11 +42,21 @@ uint256 public slashCooldown
3842

3943

4044
### lastSlashTimestamp
41-
Timestamp of the last successful slash.
45+
Timestamp of the last successful slash per adjudicator.
4246

4347

4448
```solidity
45-
uint256 public lastSlashTimestamp
49+
mapping(address => uint256) public lastSlashTimestamp
50+
```
51+
52+
53+
### minSlashAmount
54+
Minimum slash amount. Slashes below this are rejected unless `amount == balance`
55+
(full-balance slash). Prevents zero-amount or dust slashes from resetting the cooldown.
56+
57+
58+
```solidity
59+
uint256 public minSlashAmount
4660
```
4761

4862

@@ -56,7 +70,7 @@ constructor(address asset_, uint256 unlockPeriod_, address admin_) Locker(asset_
5670

5771
### setSlashCooldown
5872

59-
Sets the global cooldown between slash calls.
73+
Sets the per-adjudicator cooldown between slash calls.
6074

6175

6276
```solidity
@@ -69,6 +83,21 @@ function setSlashCooldown(uint256 newCooldown) external onlyRole(DEFAULT_ADMIN_R
6983
|`newCooldown`|`uint256`|The new cooldown in seconds (0 disables the cooldown).|
7084

7185

86+
### setMinSlashAmount
87+
88+
Sets the minimum slash amount.
89+
90+
91+
```solidity
92+
function setMinSlashAmount(uint256 newAmount) external onlyRole(DEFAULT_ADMIN_ROLE);
93+
```
94+
**Parameters**
95+
96+
|Name|Type|Description|
97+
|----|----|-----------|
98+
|`newAmount`|`uint256`|The new minimum amount (0 disables the minimum).|
99+
100+
72101
### slash
73102

74103
Reduces a user's locked balance and transfers the slashed tokens
@@ -98,6 +127,12 @@ function slash(address user, uint256 amount, address recipient, bytes calldata d
98127
event SlashCooldownUpdated(uint256 oldCooldown, uint256 newCooldown);
99128
```
100129

130+
### MinSlashAmountUpdated
131+
132+
```solidity
133+
event MinSlashAmountUpdated(uint256 oldAmount, uint256 newAmount);
134+
```
135+
101136
## Errors
102137
### SlashCooldownActive
103138

docs/contracts/Faucet.sol/contract.Faucet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Faucet
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Faucet.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/Faucet.sol)
33

44
**Title:**
55
Faucet — YELLOW testnet token faucet

docs/contracts/Governor.sol/contract.YellowGovernor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# YellowGovernor
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Governor.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/Governor.sol)
33

44
**Inherits:**
55
Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl, GovernorPreventLateQuorum, GovernorProposalGuardian

docs/contracts/Locker.sol/abstract.Locker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Locker
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Locker.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/Locker.sol)
33

44
**Inherits:**
55
[ILock](/src/interfaces/ILock.sol/interface.ILock.md), ReentrancyGuard

docs/contracts/NodeRegistry.sol/constants.NodeRegistry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Constants
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/NodeRegistry.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/NodeRegistry.sol)
33

44
### NAME
55

docs/contracts/NodeRegistry.sol/contract.NodeRegistry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# NodeRegistry
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/NodeRegistry.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/NodeRegistry.sol)
33

44
**Inherits:**
55
[Locker](/src/Locker.sol/abstract.Locker.md), Votes

docs/contracts/Token.sol/contract.YellowToken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# YellowToken
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Token.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/Token.sol)
33

44
**Inherits:**
55
ERC20Permit

docs/contracts/Treasury.sol/contract.Treasury.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Treasury
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Treasury.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/Treasury.sol)
33

44
**Inherits:**
55
Ownable2Step, ReentrancyGuard

docs/contracts/interfaces/ILock.sol/interface.ILock.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ILock
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/interfaces/ILock.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/interfaces/ILock.sol)
33

44
**Title:**
55
ILock
@@ -139,14 +139,15 @@ event Relocked(address indexed user, uint256 balance);
139139
### Withdrawn
140140

141141
```solidity
142-
event Withdrawn(address indexed user, uint256 balance);
142+
event Withdrawn(address indexed user, address indexed destination, uint256 balance);
143143
```
144144

145145
**Parameters**
146146

147147
|Name|Type|Description|
148148
|----|----|-----------|
149149
|`user`|`address`|The user that withdrew.|
150+
|`destination`|`address`|The address that received the tokens.|
150151
|`balance`|`uint256`|The amount withdrawn.|
151152

152153
## Errors

docs/contracts/interfaces/ISlash.sol/interface.ISlash.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ISlash
2-
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/interfaces/ISlash.sol)
2+
[Git Source](https://github.com/layer-3/yellow/blob/081e9e5ab0ebd446958aa9ad2a2b9aa91b26a69c/src/interfaces/ISlash.sol)
33

44
**Title:**
55
ISlash
@@ -61,3 +61,19 @@ The recipient cannot be the adjudicator calling slash.
6161
error RecipientIsAdjudicator();
6262
```
6363

64+
### RecipientIsUser
65+
The recipient cannot be the slashed user.
66+
67+
68+
```solidity
69+
error RecipientIsUser();
70+
```
71+
72+
### SlashAmountTooLow
73+
The slash amount is below the minimum and does not equal the full balance.
74+
75+
76+
```solidity
77+
error SlashAmountTooLow();
78+
```
79+

0 commit comments

Comments
 (0)