> For the complete documentation index, see [llms.txt](https://docs.mavenfinance.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mavenfinance.io/smart-contracts/smart-contracts-overview/governance-satellite-contract.md).

# Governance Satellite Contract

Governance Satellite Contract: Steering Maven Finance's Satellite Fleet.

As the core of Maven Finance's satellite management system, this contract regulates the operations and actions of the platform's Satellites.

The Satellite Governance contract oversees the registration of new Satellites, tracks their performance, manages their MVN staking, and ensures adherence to governance rules.&#x20;

It plays a vital role in maintaining the effective functioning of the Satellites, thereby upholding Maven Finance's vision of a transparent, democratic, and effective DeFi platform.

### Satellite Governance **Entrypoints**

#### suspendSatellite

`function suspendSatellite(address satelliteAddress, string purpose)`

Creates a new governance action to suspend the specified satellite

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name       | Type    | Description                                          |
| ---------------- | ------- | ---------------------------------------------------- |
| satelliteAddress | address | The address of the satellite to be suspended         |
| purpose          | string  | The reason for why the satellite should be suspended |

#### banSatellite

`function banSatellite(address satelliteAddress, string purpose)`

Creates a new governance action to ban the specified satellite

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name       | Type    | Description                                       |
| ---------------- | ------- | ------------------------------------------------- |
| satelliteAddress | address | The address of the satellite to be banned         |
| purpose          | string  | The reason for why the satellite should be banned |

#### restoreSatellite

`function restoreSatellite(address satelliteAddress, string purpose)`

Creates a new governance action to restore the specified satellite

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name       | Type    | Description                                         |
| ---------------- | ------- | --------------------------------------------------- |
| satelliteAddress | address | The address of the satellite to be restored         |
| purpose          | string  | The reason for why the satellite should be restored |

### Satellite Oracle Governance **Entrypoints**

#### removeAllSatelliteOracles

`function removeAllSatelliteOracles(address satelliteAddress, string purpose)`

Creates a new governance action to remove all oracles linked to the specified satellite address across all aggregator contracts

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name       | Type    | Description                                                                   |
| ---------------- | ------- | ----------------------------------------------------------------------------- |
| satelliteAddress | address | The address of the satellite which will have all oracles removed              |
| purpose          | string  | The reason for why the all oracles linked to this satellite should be removed |

#### addOracleToAggregator

`function addOracleToAggregator(address oracleAddress, address aggregatorAddress, string purpose)`

Creates a new governance action to add a given oracle (satellite) address to the specified aggregator contract

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name        | Type    | Description                                                                                    |
| ----------------- | ------- | ---------------------------------------------------------------------------------------------- |
| oracleAddress     | address | The address of the oracle (satellite) which will be added to the specified aggregator contract |
| aggregatorAddress | address | The address of the aggregator contract where the oracle (satellite) will be added              |
| purpose           | string  | The reason for why the oracle should be added to the aggregator contract                       |

#### removeOracleInAggregator

`function removeOracleInAggregator(address oracleAddress, address aggregatorAddress, string purpose)`

Creates a new governance action to remove a given oracle (satellite) address from the specified aggregator contract

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name        | Type    | Description                                                                              |
| ----------------- | ------- | ---------------------------------------------------------------------------------------- |
| oracleAddress     | address | The address of the oracle (satellite) which will be removed from the aggregator contract |
| aggregatorAddress | address | The address of the aggregator contract where the oracle (satellite) will be removed from |
| purpose           | string  | The reason for why the oracle (satellite) should be removed from the aggregator contract |

### Aggregator Governance **Entrypoints**

#### setAggregatorReference

`function setAggregatorReference(address aggregatorAddress, string oldName, string newName)`

Creates a new governance action to set a new reference name for the specified aggregator contract

{% hint style="info" %}
Can be called only by the admin, whitelisted contracts, or the aggregator contract itself
{% endhint %}

| Param Name        | Type    | Description                                                         |
| ----------------- | ------- | ------------------------------------------------------------------- |
| aggregatorAddress | address | The address of the aggregator which will have its reference updated |
| oldName           | string  | The old reference name of the aggregator                            |
| newName           | string  | The new reference name of the aggregator                            |

#### togglePauseAggregator

`function togglePauseAggregator(address aggregatorAddress, string purpose, togglePauseVariantType status)`

Creates a new governance action to toggle pausing of a specified aggregator contract

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name        | Type                           | Description                                                                   |                     |                                                                                                          |
| ----------------- | ------------------------------ | ----------------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------- |
| aggregatorAddress | address                        | The address of the aggregator which will have its pause status updated        |                     |                                                                                                          |
| purpose           | string                         | The reason for why the aggregator contract will have its pause status updated |                     |                                                                                                          |
| status            | <p>togglePauseVariantType:<br> | unit PauseAll<br>                                                             | unit UnpauseAll</p> | The new pause status of the aggregator contract; specify if all entrypoints should be paused or unpaused |

### Mistaken Transfer Governance **Entrypoints**

#### fixMistakenTransfer

`function fixMistakenTransfer(address targetContractAddress, string purpose, transferActionType transferList)`

Creates a new governance action to fix mistaken transfers from users. A transfer operation will created from the target contract address to the user for the token specified.

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name            | Type                                                                                    | Description                                                       |                                           |                                                        |                                                                                              |
| --------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| targetContractAddress | address                                                                                 | The address of the contract where mistaken transfer will be fixed |                                           |                                                        |                                                                                              |
| purpose               | string                                                                                  | The reason for the mistaken transfer fix                          |                                           |                                                        |                                                                                              |
| transferList          | <p>transferActionType: list(address to\_, <br>nat tokenAmount, <br>token tokenType)</p> | A list of transfers of tokens to recipients                       |                                           |                                                        |                                                                                              |
| to\_                  | address                                                                                 | The recipient of the mistaken transfer                            |                                           |                                                        |                                                                                              |
| tokenAmount           | nat                                                                                     | The amount of tokens to be transferred                            |                                           |                                                        |                                                                                              |
| token                 | <p>tokenType: <br>                                                                      | unit Mav <br>                                                     | (address tokenContractAddress) MRC-20<br> | (address tokenContractAddress, nat tokenId) MRC-20</p> | The token type of the token to be transferred, corresponding to either Mav, MRC-10 OR MRC-20 |

### Governance Vote **Entrypoints**

#### voteForAction

`function voteForAction(nat actionId, voteType vote)`

Vote for a governance action by a satellite

{% hint style="info" %}
Can be called only by an Active Satellite
{% endhint %}

| Param Name | Type             | Description                                |              |               |                                                                               |
| ---------- | ---------------- | ------------------------------------------ | ------------ | ------------- | ----------------------------------------------------------------------------- |
| actionId   | nat              | ID of the governance action to be voted on |              |               |                                                                               |
| vote       | <p>voteType:<br> | unit Yay<br>                               | unit Nay<br> | unit Pass</p> | Vote choices that a satellite may choose when voting on the governance action |

#### dropAction

`function dropAction(nat actionId)`

Drops a governance action

{% hint style="info" %}
Can be called only by the initiator of the governance action
{% endhint %}

| Param Name | Type | Description                               |
| ---------- | ---- | ----------------------------------------- |
| actionId   | nat  | ID of the governance action to be dropped |

### Housekeeping **Entrypoints**

#### setAdmin

`function setAdmin(address newAdminAddress)`

Sets a new admin address for the contract

{% hint style="info" %}
Can be called only by the admin or the governance contract address
{% endhint %}

| Param Name      | Type    | Description                  |
| --------------- | ------- | ---------------------------- |
| newAdminAddress | address | The address of the new admin |

#### setGovernance

`function setGovernance(address newGovernanceAddress)`

Sets a new governance contract address

{% hint style="info" %}
Can be called only by the admin or the governance contract address
{% endhint %}

| Param Name           | Type    | Description                                |
| -------------------- | ------- | ------------------------------------------ |
| newGovernanceAddress | address | The address of the new governance contract |

#### updateMetadata

`function updateMetadata(string key, bytes hash)`

Replace the hash of the contract metadata based on the provided key

{% hint style="info" %}
Can be called only by the admin (i.e. the governance proxy contract)
{% endhint %}

| Param Name | Type   | Description                                  |
| ---------- | ------ | -------------------------------------------- |
| key        | string | The key in the metadata bigmap to be updated |
| hash       | bytes  | The hash of the metadata key                 |

#### updateConfig

`function updateConfig(nat newConfigValue, governanceSatelliteConfigActionType governanceSatelliteConfigAction)`

Updates the config variables on the Governance Satellite Contract

{% hint style="info" %}
Can be called only by the admin (i.e. the governance proxy contract)
{% endhint %}

<table><thead><tr><th width="212.33333333333331">Param Name</th><th width="355">Type</th><th>Description</th></tr></thead><tbody><tr><td>newConfigValue</td><td>nat</td><td>The new value of the config parameter</td></tr><tr><td>governanceSatelliteConfigAction</td><td>governanceSatelliteConfigActionType: <br>| unit ConfigApprovalPercentage<br>| unit ConfigActionReqDurationDays<br>| unit ConfigPurposeMaxLength<br>| unit ConfigMaxActionsPerSatellite</td><td>The variant config variable to be updated</td></tr></tbody></table>

#### updateWhitelistContracts

`function updateWhitelistContracts(address whitelistContractAddress, updateType update)`

Add, update or remove a whitelist contract in the whitelistContracts map in the storage

{% hint style="info" %}
Can be called only by the admin (i.e. the governance proxy contract)
{% endhint %}

<table><thead><tr><th width="249.33333333333331">Param Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>whitelistContractAddress</td><td>address</td><td>The contract address to be updated in the whitelist contracts bigmap</td></tr><tr><td>updateType</td><td>updateType: <br>| unit Update  <br>| unit Remove</td><td>Specifies whether the whitelistContractAddress should be updated or removed from the whitelist contracts bigmap</td></tr></tbody></table>

#### updateGeneralContracts

`function updateGeneralContracts(string generalContractName, address generalContractAddress, updateType update)`

Add, update or remove a general contract in the generalContracts map in the storage

{% hint style="info" %}
Can be called only by the admin (i.e. the governance proxy contract)
{% endhint %}

| Param Name             | Type                | Description                                                                                                       |                 |                                                                                                             |
| ---------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------- |
| generalContractName    | string              | The identifier key to be set in the general contracts bigmap which will be the general contract name in camelcase |                 |                                                                                                             |
| generalContractAddress | address             | The contract address to be updated in the general contracts bigmap                                                |                 |                                                                                                             |
| updateType             | <p>updateType: <br> | unit Update <br>                                                                                                  | unit Remove</p> | Specifies whether the generalContractAddress should be updated or removed from the general contracts bigmap |

#### mistakenTransfer

`function mistakenTransfer(transferActionType transferList)`

Transfers any mav or token that may have mistakenly been sent to this contract

{% hint style="info" %}
Can be called only by the admin or the governance satellite contract
{% endhint %}

<table><thead><tr><th width="190.33333333333331">Param Name</th><th width="347">Type</th><th>Description</th></tr></thead><tbody><tr><td>transferList</td><td><p>transferActionType:</p><p>list(address to_, <br>nat tokenAmount, <br>token tokenType)</p></td><td>A list of transfers of tokens to recipients</td></tr><tr><td>to_</td><td>address</td><td>The recipient of the mistaken transfer</td></tr><tr><td>tokenAmount</td><td>nat</td><td>The amount of tokens to be transferred</td></tr><tr><td>token</td><td>tokenType: <br>| unit Mav <br>| (address tokenContractAddress) Fa12 <br>| (address tokenContractAddress, nat tokenId)  Fa2</td><td>The token type of the token to be transferred, corresponding to either MRC-20</td></tr></tbody></table>

#### setLambda

`function setLambda(string lambdaName, bytes func_bytes)`

Sets a lambda in the contract with the given bytes and name

{% hint style="info" %}
Can be called only by the admin (i.e. the governance proxy contract)
{% endhint %}

<table><thead><tr><th width="249.33333333333331">Param Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>lambdaName</td><td>string</td><td>The name of the lambda to be set</td></tr><tr><td>func_bytes</td><td>bytes</td><td>The data of the lambda in Michelson bytes format</td></tr></tbody></table>

### View Methods

#### getAdmin

`function getAdmin()`

Returns the contract admin

#### getGovernanceAddress

`function getGovernanceAddress()`

Returns the contract governance address

#### getConfig

`function getConfig()`

Returns the contract configuration parameters

#### getWhitelistContractOpt

`function getWhitelistContractOpt(address contractAddress)`

Returns unit if contract address is whitelisted, else returns none

#### getGeneralContractOpt

`function getGeneralContractOpt(string contractName)`

Returns the contract address if the contract name is found, else returns none

#### getGovernanceSatelliteCounter

`function getGovernanceSatelliteCounter()`

Returns the latest governance satellite action counter

#### getGovernanceSatelliteVoterOpt

`function getGovernanceSatelliteVoterOpt(nat actionId * address satelliteAddress)`

Returns a vote record based on the provided governance satellite action id and satellite address, else returns none

#### getSatelliteActionsOpt

`function getSatelliteActionsOpt(nat governanceCycleId * address satelliteAddress)`

Returns a list of governance actions created by the satellite during the specified governance cycle, else returns none

#### getAggregatorOpt

`function getAggregatorOpt(string aggregatorName)`

Returns an aggregator address based on the given aggregator name, else returns none

#### getSatelliteOracleRecordOpt

`function getSatelliteOracleRecordOpt(address satelliteAddress)`

Returns a satellite oracle record based on the given satellite address, else returns none

#### getLambdaOpt

`function getLambdaOpt(string lambdaName)`

Returns a lambda in the contract for the given lambda name, else returns none
