Skip to content

Commit

Permalink
Merge branch 'main' into connect-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
mapachurro authored Dec 20, 2024
2 parents 8084a2c + bbb78c0 commit 639e88c
Show file tree
Hide file tree
Showing 82 changed files with 5,002 additions and 181 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
pull_request:
branches:
- main
paths:
- 'docs/**'

jobs:
case:
Expand Down
26 changes: 26 additions & 0 deletions docs/api/linea-smart-contracts/interfaces/igenericerrors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# `IGenericErrors`

### ZeroAddressNotAllowed

```solidity
error ZeroAddressNotAllowed()
```

_Thrown when a parameter is the zero address._

### ZeroHashNotAllowed

```solidity
error ZeroHashNotAllowed()
```

_Thrown when a parameter is the zero hash._

### ArrayLengthsDoNotMatch

```solidity
error ArrayLengthsDoNotMatch()
```

_Thrown when array lengths are mismatched._

126 changes: 126 additions & 0 deletions docs/api/linea-smart-contracts/interfaces/imessageservice.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# `IMessageService`

### MessageSent

```solidity
event MessageSent(address _from, address _to, uint256 _fee, uint256 _value, uint256 _nonce, bytes _calldata, bytes32 _messageHash)
```

Emitted when a message is sent.

__calldata has the _ because calldata is a reserved word.
We include the message hash to save hashing costs on the rollup.
This event is used on both L1 and L2._

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _from | address | The indexed sender address of the message (msg.sender). |
| _to | address | The indexed intended recipient address of the message on the other layer. |
| _fee | uint256 | The fee being being paid to deliver the message to the recipient in Wei. |
| _value | uint256 | The value being sent to the recipient in Wei. |
| _nonce | uint256 | The unique message number. |
| _calldata | bytes | The calldata being passed to the intended recipient when being called on claiming. |
| _messageHash | bytes32 | The indexed hash of the message parameters. |

### MessageClaimed

```solidity
event MessageClaimed(bytes32 _messageHash)
```

Emitted when a message is claimed.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _messageHash | bytes32 | The indexed hash of the message that was claimed. |

### FeeTooLow

```solidity
error FeeTooLow()
```

_Thrown when fees are lower than the minimum fee._

### ValueSentTooLow

```solidity
error ValueSentTooLow()
```

_Thrown when the value sent is less than the fee.
Value to forward on is msg.value - _fee._

### MessageSendingFailed

```solidity
error MessageSendingFailed(address destination)
```

_Thrown when the destination address reverts._

### FeePaymentFailed

```solidity
error FeePaymentFailed(address recipient)
```

_Thrown when the recipient address reverts._

### sendMessage

```solidity
function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable
```

Sends a message for transporting from the given chain.

_This function should be called with a msg.value = _value + _fee. The fee will be paid on the destination chain._

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _to | address | The destination address on the destination chain. |
| _fee | uint256 | The message service fee on the origin chain. |
| _calldata | bytes | The calldata used by the destination message service to call the destination contract. |

### claimMessage

```solidity
function claimMessage(address _from, address _to, uint256 _fee, uint256 _value, address payable _feeRecipient, bytes _calldata, uint256 _nonce) external
```

Deliver a message to the destination chain.
Is called by the Postman, dApp or end user.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _from | address | The msg.sender calling the origin message service. |
| _to | address | The destination address on the destination chain. |
| _fee | uint256 | The message service fee on the origin chain. |
| _value | uint256 | The value to be transferred to the destination address. |
| _feeRecipient | address payable | Address that will receive the fees. |
| _calldata | bytes | The calldata used by the destination message service to call/forward to the destination contract. |
| _nonce | uint256 | Unique message number. |

### sender

```solidity
function sender() external view returns (address originalSender)
```

Returns the original sender of the message on the origin layer.

#### Return Values

| Name | Type | Description |
| ---- | ---- | ----------- |
| originalSender | address | The original sender of the message on the origin layer. |

155 changes: 155 additions & 0 deletions docs/api/linea-smart-contracts/interfaces/ipausemanager.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# `IPauseManager`

### PauseTypeRole

```solidity
struct PauseTypeRole {
enum IPauseManager.PauseType pauseType;
bytes32 role;
}
```

### PauseType

```solidity
enum PauseType {
UNUSED,
GENERAL,
L1_L2,
L2_L1,
BLOB_SUBMISSION,
CALLDATA_SUBMISSION,
FINALIZATION,
INITIATE_TOKEN_BRIDGING,
COMPLETE_TOKEN_BRIDGING
}
```

### Paused

```solidity
event Paused(address messageSender, enum IPauseManager.PauseType pauseType)
```

Emitted when a pause type is paused.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| messageSender | address | The address performing the pause. |
| pauseType | enum IPauseManager.PauseType | The indexed pause type that was paused. |

### UnPaused

```solidity
event UnPaused(address messageSender, enum IPauseManager.PauseType pauseType)
```

Emitted when a pause type is unpaused.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| messageSender | address | The address performing the unpause. |
| pauseType | enum IPauseManager.PauseType | The indexed pause type that was unpaused. |

### PauseTypeRoleSet

```solidity
event PauseTypeRoleSet(enum IPauseManager.PauseType pauseType, bytes32 role)
```

Emitted when a pause type and its associated role are set in the `_pauseTypeRoles` mapping.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| pauseType | enum IPauseManager.PauseType | The indexed type of pause. |
| role | bytes32 | The indexed role associated with the pause type. |

### UnPauseTypeRoleSet

```solidity
event UnPauseTypeRoleSet(enum IPauseManager.PauseType unPauseType, bytes32 role)
```

Emitted when an unpause type and its associated role are set in the `_unPauseTypeRoles` mapping.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| unPauseType | enum IPauseManager.PauseType | The indexed type of unpause. |
| role | bytes32 | The indexed role associated with the unpause type. |

### IsPaused

```solidity
error IsPaused(enum IPauseManager.PauseType pauseType)
```

_Thrown when a specific pause type is paused._

### IsNotPaused

```solidity
error IsNotPaused(enum IPauseManager.PauseType pauseType)
```

_Thrown when a specific pause type is not paused and expected to be._

### pauseByType

```solidity
function pauseByType(enum IPauseManager.PauseType _pauseType) external
```

Pauses functionality by specific type.

_Requires the role mapped in pauseTypeRoles for the pauseType._

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _pauseType | enum IPauseManager.PauseType | The pause type value. |

### unPauseByType

```solidity
function unPauseByType(enum IPauseManager.PauseType _pauseType) external
```

Unpauses functionality by specific type.

_Requires the role mapped in unPauseTypeRoles for the pauseType._

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _pauseType | enum IPauseManager.PauseType | The pause type value. |

### isPaused

```solidity
function isPaused(enum IPauseManager.PauseType _pauseType) external view returns (bool pauseTypeIsPaused)
```

Check if a pause type is enabled.

#### Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| _pauseType | enum IPauseManager.PauseType | The pause type value. |

#### Return Values

| Name | Type | Description |
| ---- | ---- | ----------- |
| pauseTypeIsPaused | bool | Returns true if the pause type if paused, false otherwise. |

11 changes: 11 additions & 0 deletions docs/api/linea-smart-contracts/interfaces/ipermissionsmanager.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `IPermissionsManager`

### RoleAddress

```solidity
struct RoleAddress {
address addressWithRole;
bytes32 role;
}
```

Loading

0 comments on commit 639e88c

Please sign in to comment.