Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions docs/build/api/contracts/api-reference/app-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# AppRegistry
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/AppRegistry.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/AppRegistry.sol)

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


## State Variables
Expand All @@ -36,7 +40,7 @@ bytes32 public constant ADJUDICATOR_ROLE = keccak256("ADJUDICATOR_ROLE")


### slashCooldown
Minimum time (seconds) that must elapse between any two slash calls.
Minimum time (seconds) that must elapse between consecutive slashes by the same adjudicator.


```solidity
Expand All @@ -45,11 +49,21 @@ uint256 public slashCooldown


### lastSlashTimestamp
Timestamp of the last successful slash.
Timestamp of the last successful slash per adjudicator.


```solidity
uint256 public lastSlashTimestamp
mapping(address => uint256) public lastSlashTimestamp
```


### minSlashAmount
Minimum slash amount. Slashes below this are rejected unless `amount == balance`
(full-balance slash). Prevents zero-amount or dust slashes from resetting the cooldown.


```solidity
uint256 public minSlashAmount
```


Expand All @@ -63,7 +77,7 @@ constructor(address asset_, uint256 unlockPeriod_, address admin_) Locker(asset_

### setSlashCooldown

Sets the global cooldown between slash calls.
Sets the per-adjudicator cooldown between slash calls.


```solidity
Expand All @@ -76,6 +90,21 @@ function setSlashCooldown(uint256 newCooldown) external onlyRole(DEFAULT_ADMIN_R
|`newCooldown`|`uint256`|The new cooldown in seconds (0 disables the cooldown).|


### setMinSlashAmount

Sets the minimum slash amount.


```solidity
function setMinSlashAmount(uint256 newAmount) external onlyRole(DEFAULT_ADMIN_ROLE);
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`newAmount`|`uint256`|The new minimum amount (0 disables the minimum).|


### slash

Reduces a user's locked balance and transfers the slashed tokens
Expand Down Expand Up @@ -105,6 +134,12 @@ function slash(address user, uint256 amount, address recipient, bytes calldata d
event SlashCooldownUpdated(uint256 oldCooldown, uint256 newCooldown);
```

### MinSlashAmountUpdated

```solidity
event MinSlashAmountUpdated(uint256 oldAmount, uint256 newAmount);
```

## Errors
### SlashCooldownActive

Expand Down
2 changes: 1 addition & 1 deletion docs/build/api/contracts/api-reference/faucet.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# Faucet
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Faucet.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/Faucet.sol)

**Title:**
Faucet — YELLOW testnet token faucet
Expand Down
5 changes: 3 additions & 2 deletions docs/build/api/contracts/api-reference/interfaces/ilock.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# ILock
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/interfaces/ILock.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/interfaces/ILock.sol)

**Title:**
ILock
Expand Down Expand Up @@ -146,14 +146,15 @@ event Relocked(address indexed user, uint256 balance);
### Withdrawn

```solidity
event Withdrawn(address indexed user, uint256 balance);
event Withdrawn(address indexed user, address indexed destination, uint256 balance);
```

**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`user`|`address`|The user that withdrew.|
|`destination`|`address`|The address that received the tokens.|
|`balance`|`uint256`|The amount withdrawn.|

## Errors
Expand Down
18 changes: 17 additions & 1 deletion docs/build/api/contracts/api-reference/interfaces/islash.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# ISlash
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/interfaces/ISlash.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/interfaces/ISlash.sol)

**Title:**
ISlash
Expand Down Expand Up @@ -68,3 +68,19 @@ The recipient cannot be the adjudicator calling slash.
error RecipientIsAdjudicator();
```

### RecipientIsUser
The recipient cannot be the slashed user.


```solidity
error RecipientIsUser();
```

### SlashAmountTooLow
The slash amount is below the minimum and does not equal the full balance.


```solidity
error SlashAmountTooLow();
```

2 changes: 1 addition & 1 deletion docs/build/api/contracts/api-reference/locker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# Locker
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Locker.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/Locker.sol)

**Inherits:**
[ILock](/src/interfaces/ILock.sol/interface.ILock.md), ReentrancyGuard
Expand Down
2 changes: 1 addition & 1 deletion docs/build/api/contracts/api-reference/node-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# NodeRegistry
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/NodeRegistry.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/NodeRegistry.sol)

**Inherits:**
[Locker](/src/Locker.sol/abstract.Locker.md), Votes
Expand Down
2 changes: 1 addition & 1 deletion docs/build/api/contracts/api-reference/treasury.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# Treasury
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Treasury.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/Treasury.sol)

**Inherits:**
Ownable2Step, ReentrancyGuard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# YellowGovernor
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Governor.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/Governor.sol)

**Inherits:**
Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl, GovernorPreventLateQuorum, GovernorProposalGuardian
Expand Down
2 changes: 1 addition & 1 deletion docs/build/api/contracts/api-reference/yellow-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ displayed_sidebar: buildSidebar
---

# YellowToken
[Git Source](https://github.com/layer-3/yellow/blob/f97fcc52ddfdc5918cb91b2af5538abb0060ee27/src/Token.sol)
[Git Source](https://github.com/layer-3/yellow/blob/dcd9928fb0cdf7b35bc4cae06401284b2529d311/src/Token.sol)

**Inherits:**
ERC20Permit
Expand Down
2 changes: 1 addition & 1 deletion docs/build/api/contracts/faq.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "FAQ"
description: "Frequently asked questions about Yellow Network smart contracts."
sidebar_position: 7
sidebar_position: 2
displayed_sidebar: buildSidebar
---

Expand Down
5 changes: 3 additions & 2 deletions docs/build/api/contracts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sidebar_position: 1
displayed_sidebar: buildSidebar
---


# Deployed Addresses

## Ethereum Mainnet (Chain ID: 1)
Expand Down Expand Up @@ -37,8 +38,8 @@ displayed_sidebar: buildSidebar
import { addresses } from "@yellow-org/contracts";

// Mainnet
addresses[1].yellowToken
addresses[1].yellowToken;

// Sepolia
addresses[11155111].faucet
addresses[11155111].faucet;
```
3 changes: 2 additions & 1 deletion docs/build/api/contracts/integration/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Emitted by both NodeRegistry and AppRegistry (inherited from Locker).
| `Locked` | `user` (address), `deposited` (uint256), `newBalance` (uint256) | `user` |
| `Relocked` | `user` (address), `balance` (uint256) | `user` |
| `UnlockInitiated` | `user` (address), `balance` (uint256), `availableAt` (uint256) | `user` |
| `Withdrawn` | `user` (address), `balance` (uint256) | `user` |
| `Withdrawn` | `user` (address), `destination` (address), `balance` (uint256) | `user`, `destination` |

## Voting Events

Expand All @@ -36,6 +36,7 @@ Emitted by AppRegistry only.

| Event | Parameters | Indexed |
|---|---|---|
| `MinSlashAmountUpdated` | `oldAmount` (uint256), `newAmount` (uint256) | — |
| `RoleAdminChanged` | `role` (bytes32), `previousAdminRole` (bytes32), `newAdminRole` (bytes32) | `role`, `previousAdminRole`, `newAdminRole` |
| `RoleGranted` | `role` (bytes32), `account` (address), `sender` (address) | `role`, `account`, `sender` |
| `RoleRevoked` | `role` (bytes32), `account` (address), `sender` (address) | `role`, `account`, `sender` |
Expand Down
1 change: 0 additions & 1 deletion docs/build/api/contracts/sdk/_category_.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"label": "SDK",
"position": 5,
"key": "contracts-sdk",
"link": {
"type": "generated-index"
},
Expand Down
6 changes: 3 additions & 3 deletions docs/build/api/contracts/sdk/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import {
|---|---|---|---|
| `YellowTokenAbi` | YellowToken | 33 | ERC-20 + EIP-2612 permit |
| `NodeRegistryAbi` | NodeRegistry | 48 | Staking + voting (ILock + IVotes) |
| `AppRegistryAbi` | AppRegistry | 46 | Collateral + slashing (ILock + ISlash + AccessControl) |
| `AppRegistryAbi` | AppRegistry | 51 | Collateral + slashing (ILock + ISlash + AccessControl) |
| `YellowGovernorAbi` | YellowGovernor | 98 | Governance (Governor + extensions) |
| `TimelockControllerAbi` | TimelockController | 46 | Delayed execution |
| `TreasuryAbi` | Treasury | 16 | Foundation vault |
| `FaucetAbi` | Faucet | 16 | Testnet faucet |
| `ILockAbi` | ILock | 19 | Lock/unlock interface (shared by both registries) |
| `ISlashAbi` | ISlash | 4 | Slash interface |
| `ISlashAbi` | ISlash | 6 | Slash interface |

### Interface ABIs

Expand Down Expand Up @@ -86,4 +86,4 @@ type ContractAddresses = {

### Current Addresses

See [Deployed Addresses](../index.md) for the full list.
See [Deployed Addresses](../operations/addresses.md) for the full list.
Loading
Loading