Skip to main content

Solidity API

Contract: IPOP

External Functions

voteOnAttestation

function voteOnAttestationfunction voteOnAttestation(bytes32 attestationUID, uint256 amount) external
Allows users to vote on an attestation to increase its popularity

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation
amountThe amount of tokens to vote with

requestVoteWithdrawal

function requestVoteWithdrawalfunction requestVoteWithdrawal(bytes32 attestationUID, uint256 amount) external
Allows users to request withdrawal of their votes

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation
amountThe amount of tokens to withdraw

withdrawVotes

function withdrawVotesfunction withdrawVotes(bytes32 attestationUID) external
Allows users to withdraw their tokens after timelock period

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation

getPopularityScore

function getPopularityScorefunction getPopularityScore(bytes32 attestationUID) external view returns (uint256)
Returns the popularity score of an attestation

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation

Return Values

Description
The popularity score

getUserVotedAmount

function getUserVotedAmountfunction getUserVotedAmount(bytes32 attestationUID, address user) external view returns (uint256)
Returns the amount of tokens voted by a user for an attestation

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation
userThe address of the user

Return Values

Description
The amount of tokens voted

getTotalVotedAmount

function getTotalVotedAmountfunction getTotalVotedAmount(bytes32 attestationUID) external view returns (uint256)
Returns the total amount of tokens voted for an attestation

Parameters

NameDescription
attestationUIDThe unique identifier of the attestation

Return Values

Description
The total amount of tokens voted

getTopAttestations

function getTopAttestationsfunction getTopAttestations(uint256 count) external view returns (bytes32[])
Get top N most popular attestations

Parameters

NameDescription
countThe number of attestations to return

Return Values

Description
An array of attestation UIDs sorted by popularity

getTopAttestationsWithScores

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