# Hord Congress

## Code

`HordCongress.sol`

## Address

`HordCongress` is deployed at [`0x086A6d9FD61758096CF4F394AE7C1F9B6b4EEC14`](https://etherscan.io/address/0x086A6d9FD61758096CF4F394AE7C1F9B6b4EEC14) on the Ethereum mainnet.

## Overview

Standard implementation of the [`multisignature`](https://101blockchains.com/multisignature-wallets/) wallet. This contract contains the initial total supply of [`HORD`](broken://pages/Mx1lBoyS6lbVRaCFNBbC) tokens.

## Events

### ProposalCreated

```solidity
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, string description);
```

* Emitted each time when a new proposal is created.

### VoteCast

```solidity
event VoteCast(address voter, uint proposalId, bool support);
```

* Emitted each time when a vote has been cast on a proposal.

### ProposalCanceled

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

* Emitted each time when a proposal has been canceled.

### ProposalExecuted

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

* Emitted each time when a proposal has been executed.

### ReceivedEther

```solidity
event ReceivedEther(address sender, uint amount);
```

* Emitted each time when ether is received.

### ExecuteTransaction

```solidity
event ExecuteTransaction(address indexed target, uint value, string signature,  bytes data);
```

* Emitted each time when transaction is executed.

## Read-Only Functions

### name

```solidity
function name() external view returns (string memory);
```

* Returns the name of the contract. \[`HordCongress`]

### proposalCount

```solidity
function proposalCount() external view returns (uint);
```

* Returns the total number of proposals.

### proposals

```solidity
function proposals(uint256 proposalId) external view returns (Proposal memory);
```

* Returns official record of all proposals ever proposed.

### getActions

```solidity
function getActions(uint proposalId) external view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas);
```

* Returns all actions from exact proposal.

### getMembersRegistry

```solidity
function getMembersRegistry()external view returns (address);
```

* Returns the address of [`HordCongressMembersRegistry`](broken://pages/vU9HzG681yyAHYBCAVHS) contract.

## State-Changing Functions

### setMembersRegistry

```solidity
function setMembersRegistry(address _membersRegistry) external;
```

* One time call function to set address of `HordCongressMembersRegistry` contract.

### propose

```solidity
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) external onlyMember returns (uint);
```

* Only a member of `HordCongress` can call this function in order to create a proposal for which members will vote and based on the votes the proposal will be executed or rejected.
* Returns id of new proposal.
* Emits a `ProposalCreated` event.

### castVote

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

* Only a member of `HordCongress` can call this function in order to vote on a specific proposal.
* Emits a `VoteCast` event.

### execute

```solidity
function execute(uint proposalId) external onlyMember payable;
```

* Only a member of `HordCongress` can call this function in order to execute a specific proposal which reached the minimal quorum (50% or more of the votes are in favor).
* Emits a `ExecuteTransaction` and `ProposalExecuted` events.

### cancel

```solidity
function cancel(uint proposalId) external onlyMember;
```

* Only a member of `HordCongress` can call this function in order to cancel a specific proposal which didn\`t reach the minimal quorum (less than 50% of votes are in favor).
* Emits a `ProposalCanceled` event .


---

# Agent Instructions: 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://docs.hord.fi/protocol/smart-contracts/hord-congress.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.
