# Governor

&#x20;This contract acts as an administrator to manage the voting registration, voting counting, and execution of the meshswap. It also performs important parameters of meshswap, proposal registration, and voting execution.

## Code

Github Link: (Will be updated after official launch)

## Address

* Polygon Mainnet :[ ](https://scope.klaytn.com/account/0x05343b228d61402e84d973ce114f34bc3f9e5987?tabId=txList)[0x06d057bc1129e6be214e53f04e07f1a6dcc8e390](https://polygonscan.com/address/0x06d057bc1129e6be214e53f04e07f1a6dcc8e390)

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Events" %}

## Events

**ProposalCreated**

```solidity
event ProposalCreated(uint id, address proposer, address target, string signature, bytes callData, uint startBlock, uint endBlock, string description);
```

* Events log of proposals are created
* Parameters
  * `id` : proposal ID
  * `proposer` : proposer's address
  * `target` : Address of the contract to be executed
  * `signature` : signature of the function to be executed
  * `callData` : function data to be executed
  * `startBlock` : start block number
  * `endBlock` : end block number
  * `description` : proposal details

**VoteCast**

```solidity
event VoteCast(address voter, uint proposalId, bool support, uint votes, uint againstVotes, uint forVotes, uint quorumVotes, string reason);
```

* Events log of vote
* Parameters
  * `voter` : voter's address
  * `proposalId` : proposal ID
  * `support` : support
  * `votes` : Number of vote vMESH&#x20;
  * `againstVotes` :  Number of total against vote&#x20;
  * `forVotes` : Number of total favor vote&#x20;
  * `quorumVotes` : Number of proposal quorum&#x20;
  * `reason` : reason

**ProposalCanceled**

```solidity
event ProposalCanceled(uint id);
```

* Events log of proposal canceled&#x20;

**ProposalQueued**

```solidity
event ProposalQueued(uint id, uint eta, uint tid);
```

* Events log of proposal queued

**ProposalExecuted**

```solidity
event ProposalExecuted(uint id, bool succeeded);
```

* Events log of proposal executed

**ProposalFeeSet**

```solidity
event ProposalFeeSet(uint oldProposalFee, uint proposalFee);
```

* Events log of proposal fee(MESH) changed

{% endtab %}

{% tab title="State-Changing Functions" %}

## State-Changing Functions

#### propose

```solidity
function propose(address target, string memory signature, bytes memory callData, string memory description) public returns (uint)
```

* Function used to propose a new proposal
* Sender must have delegates above the proposal threshold
* `target` : Target address for proposal calls&#x20;
* `signature` : Function signature for proposal calls&#x20;
* `callData` : Calldata for proposal call&#x20;
* `description` : String description of the proposal

#### castVote

```solidity
function castVote(uint proposalId, bool support) external 
```

* Function used to cast a vote for a proposal&#x20;
* `proposalId` : The id of the proposal to vote on&#x20;
* `support` : The support value for the vote. false=against, true=for
  {% endtab %}
  {% endtabs %}
