> For the complete documentation index, see [llms.txt](https://docs.canto.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.canto.io/technical-reference/liquidity-coordinator/votingescrow.md).

# VotingEscrow

Users create and control locks on the [`VotingEscrow`](https://oklink.com/canto/address/0x2fed02d6d50a8786D53F308024400fDAD275F57C) contract. A user may only have one lock at any given time. Adding to a lock resets the 5-year lock period.

The code samples below demonstrate how to manage locks using ethers.js or foundry. You can also manage locks using a block explorer like [oklink.com/canto](https://github.com/Canto-Network/docs/blob/main/technical-reference/neofinance-coordinator/oklink.com/canto/README.md).

### Creating a Lock <a href="#creating-a-lock" id="creating-a-lock"></a>

To create a lock, call the `createLock(uint256 _value)` payable method. The call value and `_value` parameter must match.

**ethers.js**

```
amount = ethers.utils.parseEther("100") // 100 CANTO
await VotingEscrow.createLock(amount, { value: amount })
```

**foundry**

```
cast send --ledger 0x... "createLock(uint256)" 100 --value 100ether
```

#### Adding to a Lock <a href="#adding-to-a-lock" id="adding-to-a-lock"></a>

To add to your existing lock, call the `increaseAmount(uint256 _value)` payable method. The call value and `_value` parameter must match.

**ethers.js**

```
amount = ethers.utils.parseEther("100") // 100 CANTO
await VotingEscrow.increaseAmount(amount, { value: amount })
```

**foundry**

```
cast send --ledger 0x... "increaseAmount(uint256)" 100 --value 100ether
```

### Reading Voting Power <a href="#reading-voting-power" id="reading-voting-power"></a>

To read voting power, call the `balanceOf(address _owner)` view.

**ethers.js**

```
const votingPower = await VotingEscrow.balanceOf("0x...")
```

**foundry**

```
cast call 0x... "balanceOf(address)" 0x...
```

### Withdrawing <a href="#withdrawing" id="withdrawing"></a>

To withdraw a completed lock, call the `withdraw()` method.

**ethers.js**

```
await VotingEscrow.withdraw()
```

**foundry**

```
cast send --ledger 0x... "withdaw()"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.canto.io/technical-reference/liquidity-coordinator/votingescrow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
