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

IUserPool

Git Source

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Interface for the UserPool managing deposits, staking, and yield

Note: security-contact: team@quantillon.money

Functions

initialize

Initializes the user pool

Sets up the user pool with initial configuration and assigns roles to admin

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 _qeuro,
    address _usdc,
    address _vault,
    address _yieldShift,
    address _timelock,
    address _treasury
) external;

Parameters

NameTypeDescription
adminaddressAdmin address
_qeuroaddressQEURO token address
_usdcaddressUSDC token address
_vaultaddressVault contract address
_yieldShiftaddressYieldShift contract address
_timelockaddressTimelock contract address
_treasuryaddressTreasury address

deposit

Deposit USDC to mint QEURO and join the pool

Converts USDC to QEURO and adds user to the pool for yield distribution

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 deposit(uint256 usdcAmount, uint256 minQeuroOut) external returns (uint256 qeuroMinted);

Parameters

NameTypeDescription
usdcAmountuint256Amount of USDC to deposit
minQeuroOutuint256Minimum QEURO expected (slippage protection)

Returns

NameTypeDescription
qeuroMinteduint256Amount of QEURO minted to user

withdraw

Withdraw USDC by burning QEURO

Converts QEURO back to USDC and removes user from the pool

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 withdraw(uint256 qeuroAmount, uint256 minUsdcOut) external returns (uint256 usdcReceived);

Parameters

NameTypeDescription
qeuroAmountuint256Amount of QEURO to burn
minUsdcOutuint256Minimum USDC expected

Returns

NameTypeDescription
usdcReceiveduint256USDC received by user

stake

Stake QEURO to earn staking rewards

Locks QEURO tokens to earn staking rewards with cooldown period

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 stake(uint256 qeuroAmount) external;

Parameters

NameTypeDescription
qeuroAmountuint256Amount of QEURO to stake

requestUnstake

Request to unstake staked QEURO (starts cooldown)

Initiates unstaking process with cooldown period before final withdrawal

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 requestUnstake(uint256 qeuroAmount) external;

Parameters

NameTypeDescription
qeuroAmountuint256Amount to unstake

unstake

Finalize unstake after cooldown

Completes the unstaking process after cooldown period has passed

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 unstake() external;

claimStakingRewards

Claim accumulated staking rewards

Claims all accumulated staking rewards for 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 claimStakingRewards() external returns (uint256 rewardAmount);

Returns

NameTypeDescription
rewardAmountuint256Amount of rewards claimed

distributeYield

Distribute new yield to the user pool

Distributes yield to all pool participants based on their share

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 distributeYield(uint256 yieldAmount) external;

Parameters

NameTypeDescription
yieldAmountuint256Amount of yield in USDC equivalent

getUserDeposits

Get a user's total deposits (USDC equivalent)

Returns the total USDC equivalent value of user's deposits

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 getUserDeposits(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressAddress to query

Returns

NameTypeDescription
<none>uint256Total deposits in USDC equivalent

getUserStakes

Get a user's total staked QEURO

Returns the total amount of QEURO staked by the 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 getUserStakes(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressAddress to query

Returns

NameTypeDescription
<none>uint256Total staked QEURO amount

getUserPendingRewards

Get a user's pending staking rewards

Returns the amount of staking rewards available to claim

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 getUserPendingRewards(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressAddress to query

Returns

NameTypeDescription
<none>uint256Pending staking rewards amount

getUserInfo

Get detailed user info

Returns comprehensive user information including balances and staking data

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 getUserInfo(address user)
    external
    view
    returns (
        uint256 qeuroBalance,
        uint256 stakedAmount,
        uint256 pendingRewards,
        uint256 depositHistory,
        uint256 lastStakeTime,
        uint256 unstakeRequestTime,
        uint256 unstakeAmount
    );

Parameters

NameTypeDescription
useraddressAddress to query

Returns

NameTypeDescription
qeuroBalanceuint256QEURO balance from deposits
stakedAmountuint256QEURO amount staked
pendingRewardsuint256Pending staking rewards
depositHistoryuint256Total historical deposits
lastStakeTimeuint256Timestamp of last stake
unstakeRequestTimeuint256Timestamp of unstake request
unstakeAmountuint256Amount currently requested to unstake

getTotalDeposits

Total USDC-equivalent deposits in the pool

Returns the total value of all deposits in the pool

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 getTotalDeposits() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total deposits in USDC equivalent

getTotalStakes

Total QEURO staked in the pool

Returns the total amount of QEURO staked by all users

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 getTotalStakes() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total staked QEURO amount

getPoolMetrics

Summary pool metrics

Returns comprehensive pool statistics and metrics

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 getPoolMetrics()
    external
    view
    returns (uint256 totalUsers_, uint256 averageDeposit, uint256 stakingRatio, uint256 poolTVL);

Returns

NameTypeDescription
totalUsers_uint256Number of users
averageDeposituint256Average deposit per user
stakingRatiouint256Staking ratio (bps)
poolTVLuint256Total value locked

getStakingAPY

Current staking APY (bps)

Returns the current annual percentage yield for staking

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 getStakingAPY() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Current staking APY in basis points

getDepositAPY

Current base deposit APY (bps)

Returns the current annual percentage yield for deposits

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 getDepositAPY() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Current deposit APY in basis points

calculateProjectedRewards

Calculate projected rewards for a staking duration

Calculates expected rewards for a given staking amount and duration

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 calculateProjectedRewards(uint256 qeuroAmount, uint256 duration)
    external
    view
    returns (uint256 projectedRewards);

Parameters

NameTypeDescription
qeuroAmountuint256QEURO amount
durationuint256Duration in seconds

Returns

NameTypeDescription
projectedRewardsuint256Expected rewards amount

updateStakingParameters

Update staking parameters

Allows governance to update staking configuration 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 updateStakingParameters(
    uint256 _stakingAPY,
    uint256 _depositAPY,
    uint256 _minStakeAmount,
    uint256 _unstakingCooldown
) external;

Parameters

NameTypeDescription
_stakingAPYuint256New staking APY (bps)
_depositAPYuint256New base deposit APY (bps)
_minStakeAmountuint256Minimum stake amount
_unstakingCooldownuint256Unstaking cooldown in seconds

setPoolFees

Set pool fees

Allows governance to update fee parameters for the pool

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 setPoolFees(uint256 _depositFee, uint256 _withdrawalFee, uint256 _performanceFee) external;

Parameters

NameTypeDescription
_depositFeeuint256Deposit fee (bps)
_withdrawalFeeuint256Withdrawal fee (bps)
_performanceFeeuint256Performance fee (bps)

emergencyUnstake

Emergency unstake for a user by admin

Allows admin to emergency unstake for a user bypassing cooldown

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 emergencyUnstake(address user) external;

Parameters

NameTypeDescription
useraddressUser address

pause

Pause user pool operations

Emergency function to pause all pool operations

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 user pool operations

Resumes all pool 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;

getPoolConfig

Pool configuration snapshot

Returns current pool configuration 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 getPoolConfig()
    external
    view
    returns (
        uint256 _stakingAPY,
        uint256 _depositAPY,
        uint256 _minStakeAmount,
        uint256 _unstakingCooldown,
        uint256 _depositFee,
        uint256 _withdrawalFee,
        uint256 _performanceFee
    );

Returns

NameTypeDescription
_stakingAPYuint256Staking APY (bps)
_depositAPYuint256Deposit APY (bps)
_minStakeAmountuint256Minimum stake amount
_unstakingCooldownuint256Unstaking cooldown seconds
_depositFeeuint256Deposit fee (bps)
_withdrawalFeeuint256Withdrawal fee (bps)
_performanceFeeuint256Performance fee (bps)

isPoolActive

Whether the pool operations are active (not paused)

Returns true if the pool is not paused and operations are active

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 isPoolActive() external view returns (bool);

Returns

NameTypeDescription
<none>boolTrue if pool operations are active

hasRole

Checks if an account has a specific role

Returns true if the account has been granted the role

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 hasRole(bytes32 role, address account) external view returns (bool);

Parameters

NameTypeDescription
rolebytes32The role to check
accountaddressThe account to check

Returns

NameTypeDescription
<none>boolTrue if the account has the role

getRoleAdmin

Gets the admin role for a given role

Returns the role that is the admin of the given role

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 getRoleAdmin(bytes32 role) external view returns (bytes32);

Parameters

NameTypeDescription
rolebytes32The role to get admin for

Returns

NameTypeDescription
<none>bytes32The admin role

grantRole

Grants a role to an account

Can only be called by an account with the admin role

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 grantRole(bytes32 role, address account) external;

Parameters

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

revokeRole

Revokes a role from an account

Can only be called by an account with the admin role

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 revokeRole(bytes32 role, address account) external;

Parameters

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

renounceRole

Renounces a role from the caller

The caller gives up their own role

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 renounceRole(bytes32 role, address callerConfirmation) external;

Parameters

NameTypeDescription
rolebytes32The role to renounce
callerConfirmationaddressConfirmation that the caller is renouncing their own role

paused

Checks if the contract is paused

Returns true if the contract is currently paused

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 paused() external view returns (bool);

Returns

NameTypeDescription
<none>boolTrue if paused, false otherwise

upgradeTo

Upgrades the contract to a new implementation

Can only be called by accounts with UPGRADER_ROLE

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 upgradeTo(address newImplementation) external;

Parameters

NameTypeDescription
newImplementationaddressAddress of the new implementation contract

upgradeToAndCall

Upgrades the contract to a new implementation and calls a function

Can only be called by accounts with UPGRADER_ROLE

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 upgradeToAndCall(address newImplementation, bytes memory data) external payable;

Parameters

NameTypeDescription
newImplementationaddressAddress of the new implementation contract
databytesEncoded function call data

GOVERNANCE_ROLE

Returns the governance role identifier

Role that can update pool parameters and governance functions

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 GOVERNANCE_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The governance role bytes32 identifier

EMERGENCY_ROLE

Returns the emergency role identifier

Role that can pause the pool and perform emergency operations

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 EMERGENCY_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The emergency role bytes32 identifier

UPGRADER_ROLE

Returns the upgrader role identifier

Role that can upgrade the contract implementation

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 UPGRADER_ROLE() external view returns (bytes32);

Returns

NameTypeDescription
<none>bytes32The upgrader role bytes32 identifier

BLOCKS_PER_DAY

Returns the number of blocks per day

Used for reward calculations

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 BLOCKS_PER_DAY() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Number of blocks per day

MAX_REWARD_PERIOD

Returns the maximum reward period

Maximum duration for reward calculations

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 MAX_REWARD_PERIOD() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Maximum reward period in seconds

qeuro

Returns the QEURO token address

The euro-pegged stablecoin token used in the pool

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 qeuro() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the QEURO token contract

usdc

Returns the USDC token address

The collateral token used for deposits

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 usdc() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the USDC token contract

vault

Returns the vault contract address

The vault contract used for minting/burning QEURO

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 vault() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the vault contract

yieldShift

Returns the yield shift contract address

The contract managing yield distribution

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 yieldShift() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the yield shift contract

stakingAPY

Returns the current staking APY

Annual percentage yield for staking (in basis points)

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 stakingAPY() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Current staking APY in basis points

depositAPY

Returns the current deposit APY

Annual percentage yield for deposits (in basis points)

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 depositAPY() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Current deposit APY in basis points

minStakeAmount

Returns the minimum stake amount

Minimum amount of QEURO required to stake

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 minStakeAmount() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Minimum stake amount in QEURO

unstakingCooldown

Returns the unstaking cooldown period

Time in seconds before unstaking can be completed

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 unstakingCooldown() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Unstaking cooldown in seconds

depositFee

Returns the deposit fee

Fee charged on deposits (in basis points)

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 depositFee() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Deposit fee in basis points

withdrawalFee

Returns the withdrawal fee

Fee charged on withdrawals (in basis points)

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 withdrawalFee() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Withdrawal fee in basis points

performanceFee

Returns the performance fee

Fee charged on performance (in basis points)

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 performanceFee() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Performance fee in basis points

totalDeposits

Returns the total deposits

Total USDC equivalent value of all deposits

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 totalDeposits() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total deposits in USDC equivalent

totalStakes

Returns the total stakes

Total amount of QEURO staked by all users

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 totalStakes() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total staked QEURO amount

totalUsers

Returns the total number of users

Number of users who have deposited or staked

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 totalUsers() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total number of users

accumulatedYieldPerShare

Returns the accumulated yield per share

Used for calculating user 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 accumulatedYieldPerShare() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Accumulated yield per share

lastYieldDistribution

Returns the last yield distribution timestamp

Timestamp of the last yield distribution

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 lastYieldDistribution() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Last yield distribution timestamp

totalYieldDistributed

Returns the total yield distributed

Total amount of yield distributed to users

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 totalYieldDistributed() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total yield distributed

userLastRewardBlock

Returns the last reward block for a user

Last block when user rewards were calculated

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 userLastRewardBlock(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressThe user address

Returns

NameTypeDescription
<none>uint256Last reward block number

hasDeposited

Checks if a user has deposited

Returns true if the user has ever deposited

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 hasDeposited(address user) external view returns (bool);

Parameters

NameTypeDescription
useraddressThe user address

Returns

NameTypeDescription
<none>boolTrue if user has deposited

userInfo

Returns detailed user information

Returns comprehensive user data including balances and staking info

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 userInfo(address user)
    external
    view
    returns (
        uint256 qeuroBalance,
        uint256 stakedAmount,
        uint256 pendingRewards,
        uint256 depositHistory,
        uint256 lastStakeTime,
        uint256 unstakeRequestTime,
        uint256 unstakeAmount
    );

Parameters

NameTypeDescription
useraddressThe user address

Returns

NameTypeDescription
qeuroBalanceuint256QEURO balance from deposits
stakedAmountuint256QEURO amount staked
pendingRewardsuint256Pending staking rewards
depositHistoryuint256Total historical deposits
lastStakeTimeuint256Timestamp of last stake
unstakeRequestTimeuint256Timestamp of unstake request
unstakeAmountuint256Amount currently requested to unstake

recoverToken

Recovers ERC20 tokens sent by mistake

Allows governance to recover accidentally sent ERC20 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 recoverToken(address token, uint256 amount) external;

Parameters

NameTypeDescription
tokenaddressToken address
amountuint256Amount to transfer

recoverETH

Recovers ETH sent by mistake

Allows governance to recover accidentally sent ETH

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 recoverETH() external;