> For the complete documentation index, see [llms.txt](https://docs.paladin.vote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paladin.vote/vote-flywheel/smart-contracts/holypalpower.md).

# HolyPalPower

Converts the hPAL Locks into a decreasing balance, similar to a veToken, with a Point structure (bias & slope). Allows to fetch past total locked supply and users past Locks

#### hPal

```solidity
address hPal
```

Address of the hPAL contract

#### balanceOf

```solidity
function balanceOf(address user) external view returns (uint256)
```

Returns the hPalPower balance of a user

**Parameters**

| Name | Type    | Description         |
| ---- | ------- | ------------------- |
| user | address | Address of the user |

**Return Values**

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| \[0] | uint256 | uint256 : hPalPower balance |

#### balanceOfAt

```solidity
function balanceOfAt(address user, uint256 timestamp) external view returns (uint256)
```

Returns the hPalPower balance of a user at a given timestamp

**Parameters**

| Name      | Type    | Description                     |
| --------- | ------- | ------------------------------- |
| user      | address | Address of the user             |
| timestamp | uint256 | Timestamp to get the balance at |

**Return Values**

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| \[0] | uint256 | uint256 : hPalPower balance |

#### getUserPoint

```solidity
function getUserPoint(address user) external view returns (struct IHolyPalPower.Point)
```

Returns the user Point (slope & bias) for the current Lock

**Parameters**

| Name | Type    | Description         |
| ---- | ------- | ------------------- |
| user | address | Address of the user |

**Return Values**

| Name | Type                       | Description        |
| ---- | -------------------------- | ------------------ |
| \[0] | struct IHolyPalPower.Point | Point : User Point |

#### getUserPointAt

```solidity
function getUserPointAt(address user, uint256 timestamp) external view returns (struct IHolyPalPower.Point)
```

Returns the user Point (slope & bias) for the Lock at a given timestamp

**Parameters**

| Name      | Type    | Description                     |
| --------- | ------- | ------------------------------- |
| user      | address | Address of the user             |
| timestamp | uint256 | Timestamp to get the balance at |

**Return Values**

| Name | Type                       | Description        |
| ---- | -------------------------- | ------------------ |
| \[0] | struct IHolyPalPower.Point | Point : User Point |

#### locked\_\_end

```solidity
function locked__end(address user) external view returns (uint256)
```

Returns the user Lock end timestamp

**Parameters**

| Name | Type    | Description         |
| ---- | ------- | ------------------- |
| user | address | Address of the user |

**Return Values**

| Name | Type    | Description                  |
| ---- | ------- | ---------------------------- |
| \[0] | uint256 | uint256 : Lock end timestamp |

#### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

Returns the total hPALPower supply

**Return Values**

| Name | Type    | Description                      |
| ---- | ------- | -------------------------------- |
| \[0] | uint256 | uint256 : Total hPALPower supply |

#### totalLocked

```solidity
function totalLocked() external view returns (uint256)
```

Returns the total amount of hPAL locked

**Return Values**

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| \[0] | uint256 | uint256 : Total hPAL locked |

#### totalLockedAt

```solidity
function totalLockedAt(uint256 blockNumber) external view returns (uint256)
```

Returns the total amount of hPAL locked at a given block

**Parameters**

| Name        | Type    | Description                                    |
| ----------- | ------- | ---------------------------------------------- |
| blockNumber | uint256 | Number of the block to get the total locked at |

**Return Values**

| Name | Type    | Description                 |
| ---- | ------- | --------------------------- |
| \[0] | uint256 | uint256 : Total hPAL locked |

#### findTotalLockedAt

```solidity
function findTotalLockedAt(uint256 timestamp) external view returns (uint256)
```

Finds the total amount of hPAL locked at a given timestamp

**Parameters**

| Name      | Type    | Description                            |
| --------- | ------- | -------------------------------------- |
| timestamp | uint256 | Timestamp to find the block number for |

**Return Values**

| Name | Type    | Description                                          |
| ---- | ------- | ---------------------------------------------------- |
| \[0] | uint256 | uint256 : Total Supply found for the given timestamp |


---

# 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.paladin.vote/vote-flywheel/smart-contracts/holypalpower.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.
