> For the complete documentation index, see [llms.txt](https://dev.abracadabra.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.abracadabra.money/token-related/mspell/mspellsender.md).

# mSpellSender

mSPELL sender is responsible from claiming the fees in the Withdrawer (*it is the owner of the withdrawer and can access funds this way)* and distributing it to the 3 recipients:

* the Treasury (based on the [treasuryPercentage](#treasurypercentage) value)
* Staking contracts, divided into:
  * sSPELL (based on the amount of SPELL staked)
  * mSPELL (based on the total amount of SPELL staked on all chains)

For mSPELL specifically, the sender will bridge the funds to the mSpellStaking contracts in the right amount (based on the amount of SPELL staked) on all chains.

### `Constructor`[​](https://smart-docs.vercel.app/contract#constructor) <a href="#constructor" id="constructor"></a>

#### `nonpayable`[​](https://smart-docs.vercel.app/contract#constructor) <a href="#constructor" id="constructor"></a>

**Parameters**

No parameters found in the constructor.

### Functions[​](https://smart-docs.vercel.app/contract#functions) <a href="#functions" id="functions"></a>

* [addMSpellRecipient](https://smart-docs.vercel.app/contract#addMSpellRecipient)
* [addReporter](https://smart-docs.vercel.app/contract#addReporter)
* [bridgeMim](https://smart-docs.vercel.app/contract#bridgeMim)
* [changePurchaser](https://smart-docs.vercel.app/contract#changePurchaser)
* [checker](https://smart-docs.vercel.app/contract#checker)
* [claimOwnership](https://smart-docs.vercel.app/contract#claimOwnership)
* [isActiveChain](https://smart-docs.vercel.app/contract#isActiveChain)
* [isOperator](https://smart-docs.vercel.app/contract#isOperator)
* [lzReceive](https://smart-docs.vercel.app/contract#lzReceive)
* [mSpellReporter](https://smart-docs.vercel.app/contract#mSpellReporter)
* [owner](https://smart-docs.vercel.app/contract#owner)
* [pendingOwner](https://smart-docs.vercel.app/contract#pendingOwner)
* [recipients](https://smart-docs.vercel.app/contract#recipients)
* [setOperator](https://smart-docs.vercel.app/contract#setOperator)
* [sspellBuyBack](https://smart-docs.vercel.app/contract#sspellBuyBack)
* [transferOwnership](https://smart-docs.vercel.app/contract#transferOwnership)
* [transferWithdrawer](https://smart-docs.vercel.app/contract#transferWithdrawer)
* [treasury](https://smart-docs.vercel.app/contract#treasury)
* [treasuryPercentage](https://smart-docs.vercel.app/contract#treasuryPercentage)

***

#### `addMSpellRecipientnonpayable`[​](https://smart-docs.vercel.app/contract#addMSpellRecipient) <a href="#addmspellrecipient" id="addmspellrecipient"></a>

**Parameters**

| Name          | Type      |
| ------------- | --------- |
| **recipient** | `address` |
| **chainId**   | `uint256` |
| **chainIdLZ** | `uint256` |

**Return values**

No return values for this function.

#### `addReporternonpayable`[​](https://smart-docs.vercel.app/contract#addReporter) <a href="#addreporter" id="addreporter"></a>

**Parameters**

| Name          | Type      |
| ------------- | --------- |
| **reporter**  | `bytes`   |
| **chainIdLZ** | `uint256` |

**Return values**

No return values for this function.

#### `bridgeMimnonpayable`[​](https://smart-docs.vercel.app/contract#bridgeMim) <a href="#bridgemim" id="bridgemim"></a>

**Parameters**

No parameters for this function.

**Return values**

No return values for this function.

#### `changePurchasernonpayable`[​](https://smart-docs.vercel.app/contract#changePurchaser) <a href="#changepurchaser" id="changepurchaser"></a>

**Parameters**

| Name                     | Type      |
| ------------------------ | --------- |
| **\_purchaser**          | `address` |
| **\_treasury**           | `address` |
| **\_treasuryPercentage** | `uint256` |

**Return values**

No return values for this function.

#### `checkerview`[​](https://smart-docs.vercel.app/contract#checker) <a href="#checker" id="checker"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name            | Type    |
| --------------- | ------- |
| **canExec**     | `bool`  |
| **execPayload** | `bytes` |

#### `claimOwnershipnonpayable`[​](https://smart-docs.vercel.app/contract#claimOwnership) <a href="#claimownership" id="claimownership"></a>

**Parameters**

No parameters for this function.

**Return values**

No return values for this function.

#### `isActiveChainview`[​](https://smart-docs.vercel.app/contract#isActiveChain) <a href="#isactivechain" id="isactivechain"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `uint256` |

**Return values**

| Name         | Type     |
| ------------ | -------- |
| **isActive** | `uint8`  |
| **position** | `uint32` |

#### `isOperatorview`[​](https://smart-docs.vercel.app/contract#isOperator) <a href="#isoperator" id="isoperator"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

**Return values**

| Name  | Type   |
| ----- | ------ |
| **/** | `bool` |

#### `lzReceivenonpayable`[​](https://smart-docs.vercel.app/contract#lzReceive) <a href="#lzreceive" id="lzreceive"></a>

**Parameters**

| Name             | Type     |
| ---------------- | -------- |
| **\_srcChainId** | `uint16` |
| **\_srcAddress** | `bytes`  |
| **/**            | `uint64` |
| **\_payload**    | `bytes`  |

**Return values**

No return values for this function.

#### `mSpellReporterview`[​](https://smart-docs.vercel.app/contract#mSpellReporter) <a href="#mspellreporter" id="mspellreporter"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `uint256` |

**Return values**

| Name  | Type    |
| ----- | ------- |
| **/** | `bytes` |

#### `ownerview`[​](https://smart-docs.vercel.app/contract#owner) <a href="#owner" id="owner"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `pendingOwnerview`[​](https://smart-docs.vercel.app/contract#pendingOwner) <a href="#pendingowner" id="pendingowner"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `recipientsview`[​](https://smart-docs.vercel.app/contract#recipients) <a href="#recipients" id="recipients"></a>

**Parameters**

| Name  | Type      |
| ----- | --------- |
| **/** | `uint256` |

**Return values**

| Name             | Type      |
| ---------------- | --------- |
| **recipient**    | `address` |
| **chainId**      | `uint32`  |
| **chainIdLZ**    | `uint32`  |
| **lastUpdated**  | `uint32`  |
| **amountStaked** | `uint128` |

#### `setOperatornonpayable`[​](https://smart-docs.vercel.app/contract#setOperator) <a href="#setoperator" id="setoperator"></a>

**Parameters**

| Name         | Type      |
| ------------ | --------- |
| **operator** | `address` |
| **status**   | `bool`    |

**Return values**

No return values for this function.

#### `sspellBuyBackview`[​](https://smart-docs.vercel.app/contract#sspellBuyBack) <a href="#sspellbuyback" id="sspellbuyback"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `transferOwnershipnonpayable`[​](https://smart-docs.vercel.app/contract#transferOwnership) <a href="#transferownership" id="transferownership"></a>

**Parameters**

| Name         | Type      |
| ------------ | --------- |
| **newOwner** | `address` |
| **direct**   | `bool`    |
| **renounce** | `bool`    |

**Return values**

No return values for this function.

#### `transferWithdrawernonpayable`[​](https://smart-docs.vercel.app/contract#transferWithdrawer) <a href="#transferwithdrawer" id="transferwithdrawer"></a>

**Parameters**

| Name         | Type      |
| ------------ | --------- |
| **newOwner** | `address` |

**Return values**

No return values for this function.

#### `treasuryview`[​](https://smart-docs.vercel.app/contract#treasury) <a href="#treasury" id="treasury"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `address` |

#### `treasuryPercentageview`[​](https://smart-docs.vercel.app/contract#treasuryPercentage) <a href="#treasurypercentage" id="treasurypercentage"></a>

**Parameters**

No parameters for this function.

**Return values**

| Name  | Type      |
| ----- | --------- |
| **/** | `uint256` |

### Events (for EVM logging)[​](https://smart-docs.vercel.app/contract#events-for-evm-logging) <a href="#events-for-evm-logging" id="events-for-evm-logging"></a>

* [LogAddRecipient](https://smart-docs.vercel.app/contract#LogAddRecipient)
* [LogBridgeToRecipient](https://smart-docs.vercel.app/contract#LogBridgeToRecipient)
* [LogChangePurchaser](https://smart-docs.vercel.app/contract#LogChangePurchaser)
* [LogSetOperator](https://smart-docs.vercel.app/contract#LogSetOperator)
* [LogSetReporter](https://smart-docs.vercel.app/contract#LogSetReporter)
* [LogSpellStakedReceived](https://smart-docs.vercel.app/contract#LogSpellStakedReceived)
* [OwnershipTransferred](https://smart-docs.vercel.app/contract#OwnershipTransferred)

***

#### `LogAddRecipient`[​](https://smart-docs.vercel.app/contract#LogAddRecipient) <a href="#logaddrecipient" id="logaddrecipient"></a>

**Parameters**

| Name          | Type      | Indexed |
| ------------- | --------- | ------- |
| **recipient** | `address` | `true`  |
| **chainId**   | `uint256` | `false` |
| **chainIdLZ** | `uint256` | `false` |

#### `LogBridgeToRecipient`[​](https://smart-docs.vercel.app/contract#LogBridgeToRecipient) <a href="#logbridgetorecipient" id="logbridgetorecipient"></a>

**Parameters**

| Name          | Type      | Indexed |
| ------------- | --------- | ------- |
| **recipient** | `address` | `true`  |
| **amount**    | `uint256` | `false` |
| **chainId**   | `uint256` | `false` |

#### `LogChangePurchaser`[​](https://smart-docs.vercel.app/contract#LogChangePurchaser) <a href="#logchangepurchaser" id="logchangepurchaser"></a>

**Parameters**

| Name                     | Type      | Indexed |
| ------------------------ | --------- | ------- |
| **\_purchaser**          | `address` | `false` |
| **\_treasury**           | `address` | `false` |
| **\_treasuryPercentage** | `uint256` | `false` |

#### `LogSetOperator`[​](https://smart-docs.vercel.app/contract#LogSetOperator) <a href="#logsetoperator" id="logsetoperator"></a>

**Parameters**

| Name         | Type      | Indexed |
| ------------ | --------- | ------- |
| **operator** | `address` | `true`  |
| **status**   | `bool`    | `false` |

#### `LogSetReporter`[​](https://smart-docs.vercel.app/contract#LogSetReporter) <a href="#logsetreporter" id="logsetreporter"></a>

**Parameters**

| Name          | Type      | Indexed |
| ------------- | --------- | ------- |
| **chainIdLZ** | `uint256` | `true`  |
| **reporter**  | `bytes`   | `false` |

#### `LogSpellStakedReceived`[​](https://smart-docs.vercel.app/contract#LogSpellStakedReceived) <a href="#logspellstakedreceived" id="logspellstakedreceived"></a>

**Parameters**

| Name           | Type      | Indexed |
| -------------- | --------- | ------- |
| **srcChainId** | `uint16`  | `false` |
| **timestamp**  | `uint32`  | `false` |
| **amount**     | `uint128` | `false` |

#### `OwnershipTransferred`[​](https://smart-docs.vercel.app/contract#OwnershipTransferred) <a href="#ownershiptransferred" id="ownershiptransferred"></a>

**Parameters**

| Name              | Type      | Indexed |
| ----------------- | --------- | ------- |
| **previousOwner** | `address` | `true`  |
| **newOwner**      | `address` | `true`  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.abracadabra.money/token-related/mspell/mspellsender.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
