> For the complete documentation index, see [llms.txt](https://docs.quipuswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quipuswap.com/smart-contracts/dex-2.0/bucket-contract/entrypoints-overview/vote.md).

# vote

An entrypoint that executes voting for a bakers on this Bucket contract. Also it updates users' global rewards and the rewards of the user who votes.

### Call parameters

```pascaligo
type vote_t             is [@layout:comb] record [
  voter                   : address;
  candidate               : key_hash;
  execute_voting          : bool;
  votes                   : nat;
]
```

| Field           | Type      | Description                                  |
| --------------- | --------- | -------------------------------------------- |
| voter           | address   | A user who votes                             |
| candidate       | key\_hash | Baker the user votes for                     |
| execute\_voting | bool      | Flag that indicates: execute voting or not   |
| votes           | nat       | Amount of votes that will be used for voting |

### Usage

Only [DexCore](/smart-contracts/dex-2.0/dexcore-contract.md) contract can call this entrypoint.

### Errors

* `403` - `sender` of the transaction is not [DexCore](/smart-contracts/dex-2.0/dexcore-contract.md) contract.
* `412` - non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).
