Quantillon Protocol

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IQTIToken

Git Source

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Interface for the QTI governance token with vote-escrow mechanics

Note: security-contact: team@quantillon.money

Functions

initialize

Initializes the QTI token

Sets up initial roles and configuration for the governance token

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function initialize(address admin, address _treasury, address timelock) external;

Parameters

NameTypeDescription
adminaddressAdmin address
_treasuryaddressTreasury address
timelockaddressTimelock address

lock

Lock QTI tokens for voting power

Locks QTI tokens for a specified duration to receive voting power

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function lock(uint256 amount, uint256 lockTime) external returns (uint256 veQTI);

Parameters

NameTypeDescription
amountuint256Amount of QTI to lock (18 decimals)
lockTimeuint256Duration to lock (seconds)

Returns

NameTypeDescription
veQTIuint256Voting power received (18 decimals)

unlock

Unlock QTI tokens after lock period expires

Unlocks all expired QTI tokens and returns them to the caller

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function unlock() external returns (uint256 amount);

Returns

NameTypeDescription
amountuint256Amount of QTI unlocked (18 decimals)

batchLock

Batch lock QTI tokens for voting power

Locks multiple amounts of QTI tokens with different lock durations

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function batchLock(uint256[] calldata amounts, uint256[] calldata lockTimes)
    external
    returns (uint256[] memory veQTIAmounts);

Parameters

NameTypeDescription
amountsuint256[]Array of amounts to lock (18 decimals each)
lockTimesuint256[]Array of corresponding lock durations (seconds each)

Returns

NameTypeDescription
veQTIAmountsuint256[]Array of voting power received per lock (18 decimals each)

batchUnlock

Batch unlock QTI tokens for multiple users (admin/governance)

Unlocks expired QTI tokens for multiple users in a single transaction

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function batchUnlock(address[] calldata users) external returns (uint256[] memory amounts);

Parameters

NameTypeDescription
usersaddress[]Array of user addresses to unlock for

Returns

NameTypeDescription
amountsuint256[]Array of amounts unlocked per user (18 decimals each)

getVotingPower

Get voting power for an address

Returns the current voting power for a user based on their locked tokens

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function getVotingPower(address user) external view returns (uint256 votingPower);

Parameters

NameTypeDescription
useraddressUser address

Returns

NameTypeDescription
votingPoweruint256Current voting power (18 decimals)

updateVotingPower

Update voting power for the caller based on current time

Recalculates and updates voting power based on time decay

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function updateVotingPower() external returns (uint256 newVotingPower);

Returns

NameTypeDescription
newVotingPoweruint256Updated voting power (18 decimals)

getLockInfo

Get lock info for an address

Returns comprehensive lock information for a user

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function getLockInfo(address user)
    external
    view
    returns (
        uint256 amount,
        uint256 unlockTime,
        uint256 votingPower,
        uint256 lastClaimTime,
        uint256 initialVotingPower,
        uint256 lockTime
    );

Parameters

NameTypeDescription
useraddressUser address

Returns

NameTypeDescription
amountuint256Locked amount (18 decimals)
unlockTimeuint256Unlock timestamp
votingPoweruint256Current voting power (18 decimals)
lastClaimTimeuint256Last claim time
initialVotingPoweruint256Initial voting power when locked (18 decimals)
lockTimeuint256Original lock duration (seconds)

createProposal

Create a new governance proposal

Creates a new governance proposal with specified parameters

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function createProposal(string calldata description, uint256 votingPeriod, bytes calldata data)
    external
    returns (uint256 proposalId);

Parameters

NameTypeDescription
descriptionstringProposal description
votingPerioduint256Voting period in seconds
databytesExecution data

Returns

NameTypeDescription
proposalIduint256New proposal ID

vote

Vote on a proposal

Casts a vote on a governance proposal

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function vote(uint256 proposalId, bool support) external;

Parameters

NameTypeDescription
proposalIduint256Proposal ID
supportboolTrue for yes, false for no

batchVote

Batch vote on multiple proposals

Casts votes on multiple governance proposals in a single transaction

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function batchVote(uint256[] calldata proposalIds, bool[] calldata supportVotes) external;

Parameters

NameTypeDescription
proposalIdsuint256[]Array of proposal IDs
supportVotesbool[]Array of vote choices (true/false)

executeProposal

Execute a successful proposal

Executes a proposal that has passed voting requirements

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function executeProposal(uint256 proposalId) external;

Parameters

NameTypeDescription
proposalIduint256Proposal ID

cancelProposal

Cancel a proposal

Cancels a proposal before execution

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function cancelProposal(uint256 proposalId) external;

Parameters

NameTypeDescription
proposalIduint256Proposal ID

getProposal

Get proposal details

Returns comprehensive information about a governance proposal

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function getProposal(uint256 proposalId)
    external
    view
    returns (
        address proposer,
        uint256 startTime,
        uint256 endTime,
        uint256 forVotes,
        uint256 againstVotes,
        bool executed,
        bool canceled,
        string memory description
    );

Parameters

NameTypeDescription
proposalIduint256Proposal ID

Returns

NameTypeDescription
proposeraddressProposal creator
startTimeuint256Voting start time
endTimeuint256Voting end time
forVotesuint256Votes in favor (18 decimals)
againstVotesuint256Votes against (18 decimals)
executedboolWhether executed
canceledboolWhether canceled
descriptionstringProposal description

getReceipt

Get voting receipt for a user

Returns voting information for a specific user and proposal

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function getReceipt(uint256 proposalId, address voter)
    external
    view
    returns (bool hasVoted, bool support, uint256 votes);

Parameters

NameTypeDescription
proposalIduint256Proposal ID
voteraddressVoter address

Returns

NameTypeDescription
hasVotedboolWhether user voted
supportboolVote direction
votesuint256Number of votes cast (18 decimals)

getProposalExecutionInfo

Gets proposal execution information

Returns execution details for a specific proposal

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown

  • reentrancy: Not applicable - view function

  • access: Public access - anyone can query proposal execution info

  • oracle: No oracle dependencies

function getProposalExecutionInfo(uint256 proposalId)
    external
    view
    returns (bytes32 executionHash, uint256 executionTime, address executor);

Parameters

NameTypeDescription
proposalIduint256ID of the proposal

Returns

NameTypeDescription
executionHashbytes32Hash of the execution data
executionTimeuint256Time when proposal was executed
executoraddressAddress that executed the proposal

getProposalExecutionHash

Gets proposal execution hash

Returns the execution hash for a specific proposal

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown

  • reentrancy: Not applicable - view function

  • access: Public access - anyone can query proposal execution hash

  • oracle: No oracle dependencies

function getProposalExecutionHash(uint256 proposalId) external view returns (bytes32 executionHash);

Parameters

NameTypeDescription
proposalIduint256ID of the proposal

Returns

NameTypeDescription
executionHashbytes32Hash of the execution data

updateGovernanceParameters

Update governance parameters

Updates key governance parameters for the protocol

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function updateGovernanceParameters(uint256 _proposalThreshold, uint256 _minVotingPeriod, uint256 _quorumVotes)
    external;

Parameters

NameTypeDescription
_proposalThresholduint256New proposal threshold (18 decimals)
_minVotingPerioduint256New minimum voting period (seconds)
_quorumVotesuint256New quorum requirement (18 decimals)

updateTreasury

Update treasury address

Updates the treasury address for protocol fees and rewards

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function updateTreasury(address _treasury) external;

Parameters

NameTypeDescription
_treasuryaddressNew treasury address

updateDecentralizationLevel

Update decentralization level

Updates the decentralization level based on current protocol state

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function updateDecentralizationLevel() external;

pause

Pause the contract

Pauses all contract operations for emergency situations

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function pause() external;

unpause

Unpause the contract

Resumes all contract operations after emergency pause

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function unpause() external;

getGovernanceInfo

Get governance information

Returns comprehensive governance information in a single call

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function getGovernanceInfo()
    external
    view
    returns (
        uint256 _totalLocked,
        uint256 _totalVotingPower,
        uint256 _proposalThreshold,
        uint256 _quorumVotes,
        uint256 _currentDecentralizationLevel
    );

Returns

NameTypeDescription
_totalLockeduint256Total locked QTI (18 decimals)
_totalVotingPoweruint256Total voting power (18 decimals)
_proposalThresholduint256Proposal threshold (18 decimals)
_quorumVotesuint256Quorum requirement (18 decimals)
_currentDecentralizationLeveluint256Current decentralization level

name

Get the token name

Returns the name of the QTI token

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function name() external view returns (string memory);

Returns

NameTypeDescription
<none>stringname The token name string

symbol

Get the token symbol

Returns the symbol of the QTI token

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function symbol() external view returns (string memory);

Returns

NameTypeDescription
<none>stringsymbol The token symbol string

decimals

Get the token decimals

Returns the number of decimals used by the token

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function decimals() external view returns (uint8);

Returns

NameTypeDescription
<none>uint8decimals The number of decimals (always 18)

totalSupply

Get the total token supply

Returns the total supply of QTI tokens

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function totalSupply() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256totalSupply The total supply (18 decimals)

balanceOf

Get the balance of an account

Returns the token balance of the specified account

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function balanceOf(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddressAddress to query

Returns

NameTypeDescription
<none>uint256balance The token balance (18 decimals)

transfer

Transfer QTI tokens to another address

Standard ERC20 transfer function

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function transfer(address to, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
toaddressAddress to transfer tokens to
amountuint256Amount of tokens to transfer (18 decimals)

Returns

NameTypeDescription
<none>boolsuccess True if transfer was successful

allowance

Get the allowance for a spender

Returns the amount of tokens that a spender is allowed to transfer

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function allowance(address owner, address spender) external view returns (uint256);

Parameters

NameTypeDescription
owneraddressAddress of the token owner
spenderaddressAddress of the spender

Returns

NameTypeDescription
<none>uint256allowance Amount of tokens the spender can transfer (18 decimals)

approve

Approve a spender to transfer tokens

Sets the allowance for a spender to transfer tokens on behalf of the caller

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function approve(address spender, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
spenderaddressAddress of the spender to approve
amountuint256Amount of tokens to approve (18 decimals)

Returns

NameTypeDescription
<none>boolsuccess True if approval was successful

transferFrom

Transfer tokens from one address to another

Standard ERC20 transferFrom function

Notes:

  • security: Validates input parameters and enforces security checks

  • validation: Validates input parameters and business logic constraints

  • state-changes: Updates contract state variables

  • events: Emits relevant events for state changes

  • errors: Throws custom errors for invalid conditions

  • reentrancy: Protected by reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Requires fresh oracle price data

function transferFrom(address from, address to, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
fromaddressAddress to transfer tokens from
toaddressAddress to transfer tokens to
amountuint256Amount of tokens to transfer (18 decimals)

Returns

NameTypeDescription
<none>boolsuccess True if transfer was successful

hasRole

Check if an account has a specific role

Returns true if the account has the specified role

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can check roles

  • oracle: No oracle dependencies

function hasRole(bytes32 role, address account) external view returns (bool);

Parameters

NameTypeDescription
rolebytes32The role to check
accountaddressThe account to check

Returns

NameTypeDescription
<none>boolbool True if account has the role, false otherwise

getRoleAdmin

Get the admin role for a specific role

Returns the admin role that can grant/revoke the specified role

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query role admin

  • oracle: No oracle dependencies

function getRoleAdmin(bytes32 role) external view returns (bytes32);

Parameters

NameTypeDescription
rolebytes32The role to get admin for

Returns

NameTypeDescription
<none>bytes32bytes32 The admin role

grantRole

Grant a role to an account

Grants the specified role to the account

Notes:

  • security: Validates caller has admin role for the specified role

  • validation: Validates account is not address(0)

  • state-changes: Grants role to account

  • events: Emits RoleGranted event

  • errors: Throws AccessControlUnauthorizedAccount if caller lacks admin role

  • reentrancy: Not protected - no external calls

  • access: Restricted to role admin

  • oracle: No oracle dependencies

function grantRole(bytes32 role, address account) external;

Parameters

NameTypeDescription
rolebytes32The role to grant
accountaddressThe account to grant the role to

revokeRole

Revoke a role from an account

Revokes the specified role from the account

Notes:

  • security: Validates caller has admin role for the specified role

  • validation: Validates account is not address(0)

  • state-changes: Revokes role from account

  • events: Emits RoleRevoked event

  • errors: Throws AccessControlUnauthorizedAccount if caller lacks admin role

  • reentrancy: Not protected - no external calls

  • access: Restricted to role admin

  • oracle: No oracle dependencies

function revokeRole(bytes32 role, address account) external;

Parameters

NameTypeDescription
rolebytes32The role to revoke
accountaddressThe account to revoke the role from

renounceRole

Renounce a role

Allows an account to renounce their own role

Notes:

  • security: Validates caller is renouncing their own role

  • validation: Validates callerConfirmation matches msg.sender

  • state-changes: Revokes role from caller

  • events: Emits RoleRevoked event

  • errors: Throws AccessControlBadConfirmation if callerConfirmation != msg.sender

  • reentrancy: Not protected - no external calls

  • access: Public - anyone can renounce their own roles

  • oracle: No oracle dependencies

function renounceRole(bytes32 role, address callerConfirmation) external;

Parameters

NameTypeDescription
rolebytes32The role to renounce
callerConfirmationaddressThe caller's address for confirmation

paused

Check if the contract is paused

Returns true if the contract is currently paused

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can check pause status

  • oracle: No oracle dependencies

function paused() external view returns (bool);

Returns

NameTypeDescription
<none>boolbool True if paused, false if not paused

upgradeTo

Upgrade the contract implementation

Upgrades the contract to a new implementation

Notes:

  • security: Validates caller has UPGRADER_ROLE

  • validation: Validates newImplementation is not address(0)

  • state-changes: Updates implementation address

  • events: Emits Upgraded event

  • errors: Throws AccessControlUnauthorizedAccount if caller lacks UPGRADER_ROLE

  • reentrancy: Not protected - no external calls

  • access: Restricted to UPGRADER_ROLE

  • oracle: No oracle dependencies

function upgradeTo(address newImplementation) external;

Parameters

NameTypeDescription
newImplementationaddressAddress of the new implementation

upgradeToAndCall

Upgrade the contract implementation with initialization

Upgrades the contract to a new implementation and calls initialization function

Notes:

  • security: Validates caller has UPGRADER_ROLE

  • validation: Validates newImplementation is not address(0)

  • state-changes: Updates implementation address and calls initialization

  • events: Emits Upgraded event

  • errors: Throws AccessControlUnauthorizedAccount if caller lacks UPGRADER_ROLE

  • reentrancy: Not protected - no external calls

  • access: Restricted to UPGRADER_ROLE

  • oracle: No oracle dependencies

function upgradeToAndCall(address newImplementation, bytes memory data) external payable;

Parameters

NameTypeDescription
newImplementationaddressAddress of the new implementation
databytesInitialization data to call on new implementation

GOVERNANCE_ROLE

Returns the governance role identifier

Role required for governance operations

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query governance role

  • oracle: No oracle dependencies

function GOVERNANCE_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32bytes32 The governance role identifier

EMERGENCY_ROLE

Returns the emergency role identifier

Role required for emergency operations

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query emergency role

  • oracle: No oracle dependencies

function EMERGENCY_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32bytes32 The emergency role identifier

UPGRADER_ROLE

Returns the upgrader role identifier

Role required for contract upgrades

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query upgrader role

  • oracle: No oracle dependencies

function UPGRADER_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32bytes32 The upgrader role identifier

MAX_LOCK_TIME

Returns the maximum lock time

Maximum duration tokens can be locked for (seconds)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query maximum lock time

  • oracle: No oracle dependencies

function MAX_LOCK_TIME() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Maximum lock time in seconds

MIN_LOCK_TIME

Returns the minimum lock time

Minimum duration tokens must be locked for (seconds)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query minimum lock time

  • oracle: No oracle dependencies

function MIN_LOCK_TIME() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Minimum lock time in seconds

WEEK

Returns the week duration

Duration of one week in seconds

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query week duration

  • oracle: No oracle dependencies

function WEEK() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Week duration in seconds

MAX_VE_QTI_MULTIPLIER

Returns the maximum veQTI multiplier

Maximum voting power multiplier for locked tokens

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query maximum veQTI multiplier

  • oracle: No oracle dependencies

function MAX_VE_QTI_MULTIPLIER() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Maximum veQTI multiplier

MAX_TIME_ELAPSED

Returns the maximum time elapsed

Maximum time that can elapse for calculations

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query maximum time elapsed

  • oracle: No oracle dependencies

function MAX_TIME_ELAPSED() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Maximum time elapsed in seconds

TOTAL_SUPPLY_CAP

Returns the total supply cap

Maximum total supply of QTI tokens (18 decimals)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query total supply cap

  • oracle: No oracle dependencies

function TOTAL_SUPPLY_CAP() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Total supply cap in QTI tokens

locks

Returns lock information for an address

Returns comprehensive lock information for a user

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query lock information

  • oracle: No oracle dependencies

function locks(address user)
    external
    view
    returns (
        uint256 amount,
        uint256 unlockTime,
        uint256 votingPower,
        uint256 lastClaimTime,
        uint256 initialVotingPower,
        uint256 lockTime
    );

Parameters

NameTypeDescription
useraddressAddress of the user to query

Returns

NameTypeDescription
amountuint256Locked amount (18 decimals)
unlockTimeuint256Unlock timestamp
votingPoweruint256Current voting power (18 decimals)
lastClaimTimeuint256Last claim time
initialVotingPoweruint256Initial voting power when locked (18 decimals)
lockTimeuint256Original lock duration (seconds)

totalLocked

Returns total locked QTI tokens

Total amount of QTI tokens locked across all users (18 decimals)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query total locked

  • oracle: No oracle dependencies

function totalLocked() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Total locked QTI tokens

totalVotingPower

Returns total voting power

Total voting power across all locked tokens (18 decimals)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query total voting power

  • oracle: No oracle dependencies

function totalVotingPower() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Total voting power

proposals

Returns proposal information by ID

Returns comprehensive proposal information

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query proposal information

  • oracle: No oracle dependencies

function proposals(uint256 proposalId)
    external
    view
    returns (
        address proposer,
        uint256 startTime,
        uint256 endTime,
        uint256 forVotes,
        uint256 againstVotes,
        bool executed,
        bool canceled,
        string memory description
    );

Parameters

NameTypeDescription
proposalIduint256ID of the proposal to query

Returns

NameTypeDescription
proposeraddressProposal creator address
startTimeuint256Voting start timestamp
endTimeuint256Voting end timestamp
forVotesuint256Votes in favor (18 decimals)
againstVotesuint256Votes against (18 decimals)
executedboolWhether proposal was executed
canceledboolWhether proposal was canceled
descriptionstringProposal description

nextProposalId

Returns the next proposal ID

Counter for generating unique proposal IDs

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query next proposal ID

  • oracle: No oracle dependencies

function nextProposalId() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Next proposal ID

proposalThreshold

Returns the proposal threshold

Minimum voting power required to create proposals (18 decimals)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query proposal threshold

  • oracle: No oracle dependencies

function proposalThreshold() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Proposal threshold in QTI tokens

minVotingPeriod

Returns the minimum voting period

Minimum duration for proposal voting (seconds)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query minimum voting period

  • oracle: No oracle dependencies

function minVotingPeriod() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Minimum voting period in seconds

maxVotingPeriod

Returns the maximum voting period

Maximum duration for proposal voting (seconds)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query maximum voting period

  • oracle: No oracle dependencies

function maxVotingPeriod() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Maximum voting period in seconds

quorumVotes

Returns the quorum votes requirement

Minimum votes required for proposal execution (18 decimals)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query quorum votes

  • oracle: No oracle dependencies

function quorumVotes() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Quorum votes requirement in QTI tokens

treasury

Returns the treasury address

Address where protocol fees and rewards are sent

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query treasury address

  • oracle: No oracle dependencies

function treasury() external view returns (address);

Returns

NameTypeDescription
<none>addressaddress Treasury address

decentralizationStartTime

Returns the decentralization start time

Timestamp when decentralization process began

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query decentralization start time

  • oracle: No oracle dependencies

function decentralizationStartTime() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Decentralization start timestamp

decentralizationDuration

Returns the decentralization duration

Duration of the decentralization process (seconds)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query decentralization duration

  • oracle: No oracle dependencies

function decentralizationDuration() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Decentralization duration in seconds

currentDecentralizationLevel

Returns the current decentralization level

Current level of protocol decentralization (0-100)

Notes:

  • security: No security validations required - view function

  • validation: No input validation required - view function

  • state-changes: No state changes - view function only

  • events: No events emitted

  • errors: No errors thrown - safe view function

  • reentrancy: Not applicable - view function

  • access: Public - anyone can query current decentralization level

  • oracle: No oracle dependencies

function currentDecentralizationLevel() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 Current decentralization level

recoverToken

Recovers tokens accidentally sent to the contract

Emergency function to recover ERC20 tokens that are not part of normal operations

Notes:

  • security: Validates admin role and uses secure recovery library

  • validation: No input validation required - library handles validation

  • state-changes: Transfers tokens from contract to treasury

  • events: Emits TokenRecovered event

  • errors: No errors thrown - library handles error cases

  • reentrancy: Not protected - library handles reentrancy

  • access: Restricted to DEFAULT_ADMIN_ROLE

  • oracle: No oracle dependencies for token recovery

function recoverToken(address token, uint256 amount) external;

Parameters

NameTypeDescription
tokenaddressAddress of the token to recover
amountuint256Amount of tokens to recover

recoverETH

Recovers ETH accidentally sent to the contract

Emergency function to recover ETH that was accidentally sent to the contract

Notes:

  • security: Validates admin role and emits recovery event

  • validation: No input validation required - transfers all ETH

  • state-changes: Transfers all contract ETH balance to treasury

  • events: Emits ETHRecovered with amount and treasury address

  • errors: No errors thrown - safe ETH transfer

  • reentrancy: Not protected - no external calls

  • access: Restricted to DEFAULT_ADMIN_ROLE

  • oracle: No oracle dependencies

function recoverETH() external;