# `L1MessageServiceV1`

### nextMessageNumber

```solidity
uint256 nextMessageNumber
```

### 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.

__feeRecipient can be set to address(0) to receive as msg.sender.
The original message sender address is temporarily set in transient storage,
while claiming. This address is used in sender()._

#### 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. |

