<!-- Canonical: https://docs.linea.build/api/linea-smart-contracts/messageservice/l1/v1/l1messageservicev1 -->

> For the complete Linea documentation index, see [llms.txt](/llms.txt).
> Agents can fetch this page as Markdown at [https://docs.linea.build/api/linea-smart-contracts/messageservice/l1/v1/l1messageservicev1.md](https://docs.linea.build/api/linea-smart-contracts/messageservice/l1/v1/l1messageservicev1.md).

# L1MessageServiceV1

# `L1MessageServiceV1`

### nextMessageNumber

```solidity
uint256 nextMessageNumber
```

### _messageSender

```solidity
address _messageSender
```

_DEPRECATED in favor of new transient storage with `MESSAGE_SENDER_TRANSIENT_KEY` key._

### REFUND_OVERHEAD_IN_GAS

```solidity
uint256 REFUND_OVERHEAD_IN_GAS
```

_adding these should not affect storage as they are constants and are stored in bytecode._

### MESSAGE_SENDER_TRANSIENT_KEY

```solidity
bytes32 MESSAGE_SENDER_TRANSIENT_KEY
```

_The transient storage key to set the message sender against while claiming._

### DEFAULT_MESSAGE_SENDER_TRANSIENT_VALUE

```solidity
address DEFAULT_MESSAGE_SENDER_TRANSIENT_VALUE
```

The default value for the message sender reset to post claiming using the MESSAGE_SENDER_TRANSIENT_KEY.

### distributeFees

```solidity
modifier distributeFees(uint256 _feeInWei, address _to, bytes _calldata, address _feeRecipient)
```

The unspent fee is refunded if applicable.

#### Parameters

| Name | Type | Description |
| --- | --- | --- |
| _feeInWei | uint256 | The fee paid for delivery in Wei. |
| _to | address | The recipient of the message and gas refund. |
| _calldata | bytes | The calldata of the message. |
| _feeRecipient | address |  |

### claimMessage

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

Claims and delivers a cross-chain message.

#### Parameters

| Name | Type | Description |
| --- | --- | --- |
| _from | address | The address of the original sender. |
| _to | address | The address the message is intended for. |
| _fee | uint256 | The fee being paid for the message delivery. |
| _value | uint256 | The value to be transferred to the destination address. |
| _feeRecipient | address payable | The recipient for the fee. |
| _calldata | bytes | The calldata to pass to the recipient. |
| _nonce | uint256 | The unique auto generated nonce used when sending the message. |

Contributions not accepted

These reference pages are automatically generated based on Linea's [smart contracts](https://github.com/Consensys/linea-monorepo/tree/main/contracts/src). To ensure they accurately match the deployed smart contracts, we cannot accept any contributions that edit these pages.
