# Start EcoPot

Contracts that have acquired EcoPot Operator rights can create EcoPots using the tokens determined during creation.

{% hint style="warning" %}

1. The unit used when setting Amount is the unit including Decimal.

   Ex) 10 KLAY = 10 \* (10^18) = 10000000000000000000
2. In EcoPot setting, only one token can be set per contract, so when setting other tokens, a new EcoPotOperator Contract must be deployed.&#x20;
   {% endhint %}

### EcoPot initialize

Execute the initialize function of EcoPotOperator Contract.

* The amount of tokens required and fees should be transferred to the contract rather than deposited.
* When setting KLAY tokens, you must enter the quantity to be set in `msg.value`.
* When setting a KIP7-based token, you must set approve by the amount set in EcoPotOperator in the owner wallet.Request Parameters
* Request Parameters
  * totalAmount : Total amount of tokens to be distributed with EcoPot
  * blockAmount : Token quantity to be distributed per block
  * startBlock : EcoPot start block number

```
function initialize(
    uint totalAmount,
    uint blockAmount,
    uint startBlock,
) public
```

### EcoPot Token deposit

If you run out of tokens due to token exhaustion or extension during EcoPot, you can recharge tokens with the EcoPotOperator Contract’s Deposit function.

* When executing the function, transfer more than the amount of tokens entered in the EcoPotOperator Contract.
* When recharging due to exhaustion, it will be applied from the block after recharging.

```
function deposit(uint amount) public
```

### EcoPot refix

* Modify the amount of tokens distributed per block
* It is applied from the block after the transaction is executed.

```
function refixBlockAmount(uint blockAmount) public
```

### EcoPot check

You can check the current settings of EcoPot.

* Return Parameters
  * ecoPotContract : EcoPot Contract address
  * totalAmount : Total amount of tokens to be distributed with EcoPot
  * blockAmount : Token quantity to be distributed per block
  * distributableBlock : EcoPot start distribute block number
  * endBlock : Expected distribution end block number
  * distributed : Distributed Token
  * remain : RemainToken&#x20;

```
function getEcoPotStat() public view returns (
    address ecoPotContract, 
    uint totalAmount, 
    uint blockAmount, 
    uint distributableBlock, 
    uint endBlock,
    uint distributed, 
    uint remain
)
```

### **EcoPot withdraw**

* The remaining tokens can be withdrawn after the EcoPot plan is in progress.
* Withdrawals are made to the Owner's account.

```
function withdraw(address tokenAddr) public
```


---

# 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-new.klayswap.com/book-en/developers/ecopot/start-ecopot.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.
