IValocracy

Git Source

Functions

balanceOf

*Returns the balance of an account with decay applied. Implements the EIP-7787 decay mechanism:

  • Full balance during stable period
  • Linear decay during decay period
  • Zero balance after decay period ends*
function balanceOf(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddressThe address to check the balance for

Returns

NameTypeDescription
<none>uint256The current balance with decay applied

stablePeriod

Returns the stable period duration in seconds.

function stablePeriod() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The stable period duration

decayPeriod

Returns the decay period duration in seconds.

function decayPeriod() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The decay period duration

grantVotingUnits

Grants voting units to the specified account. Only the contract owner can mint new tokens and grant additional voting units. Updates the last participation timestamp to start the stable period.

function grantVotingUnits(address to, uint256 amount) external;

Parameters

NameTypeDescription
toaddressThe address to grant voting units to
amountuint256The amount of voting units to grant

burn

Burns tokens and reduces the voting units associated with the token holder.

function burn(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256The amount of tokens to burn

Events

VotingUnitsGranted

Emitted when voting units are granted to an account.

event VotingUnitsGranted(address indexed account, uint256 amount);

Parameters

NameTypeDescription
accountaddressThe address that received the voting units
amountuint256The amount of voting units granted

VotingUnitsBurned

Emitted when voting units are burned.

event VotingUnitsBurned(address indexed account, uint256 amount);

Parameters

NameTypeDescription
accountaddressThe address that burned the voting units
amountuint256The amount of voting units burned

Errors

TokenSoulbound

Emitted when attempting to transfer a soulbound token.

error TokenSoulbound();