# EcoPotVoting

이 컨트랙트는 EcoPot 프로젝트 생성 및 상태 관리, EcoPot 프로젝트 투표권 행사를 주관하는 컨트랙트입니다. KSP 스테이킹 유저는 원하는 EcoPot 프로젝트에 투표하여 지분율에 따라 Token을 분배받게 됩니다.&#x20;

## Address

* Cypress : [0x2ce59e21364DcA92c90970AD15442146D638997f](https://scope.klaytn.com/account/0x2ce59e21364DcA92c90970AD15442146D638997f?tabId=txList)

{% tabs %}
{% tab title="Event" %}
**CreateEcoPot**

```solidity
event CreateEcoPot(address operator, address ecoPot, address token, string name);
```

* EcoPot 생성시 발생하는 이벤트&#x20;
* Parameters
  * `operator` : EcoPotOperator 주소
  * `ecoPot` : 생성된 EcoPot 주소
  * `token` : 분배될 token 주소 &#x20;
  * `name` : EcoPot Project 이름

**RemoveEcoPot**

```solidity
event RemoveEcoPot(address ecoPot);
```

* EcoPot 종료시 발생되는 이벤트

**ChangeEcoPotAvailable**

```solidity
event ChangeEcoPotAvailable(address ecoPot, bool b);
```

* EcoPot 상태 변경시 발생되는 이벤트

**AddVoting**

```solidity
event AddVoting(address user, address ecopot, uint amount);
```

* EcoPot 투표시 발생되는 이벤트
* Parameters
  * `user` : 투표자 주소
  * `ecopot` : EcoPot 주소
  * `amount` : 투표 량

**RemoveVoting**

```solidity
event RemoveVoting(address user, address ecopot, uint amount);
```

* EcoPot 투표 철회시 발생되는 이벤트
* Parameters
  * `user` : 투표자 주소
  * `ecopot` : EcoPot 주소
  * `amount` : 철회 수량

{% endtab %}

{% tab title="Read-Only Functions" %}

## Read-Only Functions

**ecoPotCount**

* 생성된 EcoPot 개수

**MAX\_VOTING*****\_*****POT\_COUNT**

* 최대 투표 가능 EcoPot 개수

**ecoPotList**

* mapping(uint => address)
* EcoPot 주소

**ecoPotExist**

* mapping(address => bool)
* EcoPot 유무

**potTotalVotedAmount**

* EcoPot 총 투표 수

**userVotingPotCount**

* mapping(address => uint)
* 유저 투표 EcoPot 개수

**userVotingPotAddress**

```solidity
function userVotingPotAddress(address user, uint256 ecoPotIndex) public view returns (address) 
```

* 유저 투표 EcoPot 주소

**userVotingPotAmount**

```solidity
function userVotingPotAmount(address user, uint256 ecoPotIndex) public view returns (uint256) 
```

* 유저 EcoPot 투표 수

{% endtab %}

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

## **State-Changing Functions**

addVoting

```solidity
function addVoting(address ecoPot, uint amount) public
```

* EcoPot 투표 함수
* vKSP 정수 단위 허용&#x20;

removeVoting

```solidity
function removeVoting(address ecoPot, uint amount) public
```

* Ecopot 투표 철회 함수&#x20;
* Ecopot 투표 수량 범위 내의 vKSP 정수 단위 허용

removeAllVoting

```solidity
function removeAllVoting() public
```

* Ecopot 투표 풀 전체에 대한 철회 함수

claimReward

```solidity
function claimReward(address ecopot) public 
```

* Ecopot 투표 풀의 보상 청구 함수

claimRewardAll

```solidity
function claimRewardAll() public
```

* Ecopot 투표 풀 전체에 대한 보상 청구 함수
  {% endtab %}
  {% endtabs %}


---

# 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.klayswap.com/kr/developer/contract/ecopotvoting.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.
