> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cultura.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# IPOP

# Solidity API

# Contract: IPOP

## External Functions

### voteOnAttestation

```solidity theme={null}
function voteOnAttestationfunction voteOnAttestation(bytes32 attestationUID, uint256 amount) external
```

Allows users to vote on an attestation to increase its popularity

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |
| `amount`         | The amount of tokens to vote with        |

### requestVoteWithdrawal

```solidity theme={null}
function requestVoteWithdrawalfunction requestVoteWithdrawal(bytes32 attestationUID, uint256 amount) external
```

Allows users to request withdrawal of their votes

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |
| `amount`         | The amount of tokens to withdraw         |

### withdrawVotes

```solidity theme={null}
function withdrawVotesfunction withdrawVotes(bytes32 attestationUID) external
```

Allows users to withdraw their tokens after timelock period

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |

### getPopularityScore

```solidity theme={null}
function getPopularityScorefunction getPopularityScore(bytes32 attestationUID) external view returns (uint256)
```

Returns the popularity score of an attestation

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |

#### Return Values

| Description          |
| -------------------- |
| The popularity score |

### getUserVotedAmount

```solidity theme={null}
function getUserVotedAmountfunction getUserVotedAmount(bytes32 attestationUID, address user) external view returns (uint256)
```

Returns the amount of tokens voted by a user for an attestation

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |
| `user`           | The address of the user                  |

#### Return Values

| Description                |
| -------------------------- |
| The amount of tokens voted |

### getTotalVotedAmount

```solidity theme={null}
function getTotalVotedAmountfunction getTotalVotedAmount(bytes32 attestationUID) external view returns (uint256)
```

Returns the total amount of tokens voted for an attestation

#### Parameters

| Name             | Description                              |
| ---------------- | ---------------------------------------- |
| `attestationUID` | The unique identifier of the attestation |

#### Return Values

| Description                      |
| -------------------------------- |
| The total amount of tokens voted |

### getTopAttestations

```solidity theme={null}
function getTopAttestationsfunction getTopAttestations(uint256 count) external view returns (bytes32[])
```

Get top N most popular attestations

#### Parameters

| Name    | Description                          |
| ------- | ------------------------------------ |
| `count` | The number of attestations to return |

#### Return Values

| Description                                       |
| ------------------------------------------------- |
| An array of attestation UIDs sorted by popularity |

### getTopAttestationsWithScores

```solidity theme={null}
function getTopAttestationsWithScoresfunction getTopAttestationsWithScores() external view returns (bytes32[3] attestations, uint256[3] scores)
```

Get the top 3 attestations and their scores

#### Return Values

| Description                                    |
| ---------------------------------------------- |
| Array of the top 3 attestation UIDs            |
| Array of the scores for the top 3 attestations |
