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

IYieldShift

Git Source

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Interface for YieldShift dynamic yield redistribution

Note: security-contact: team@quantillon.money

Functions

initialize

Initializes the YieldShift contract

Sets up the yield shift contract 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 _usdc,
    address _userPool,
    address _hedgerPool,
    address _aaveVault,
    address _stQEURO,
    address _timelock,
    address _treasury
) external;

Parameters

NameTypeDescription
adminaddressAdmin address
_usdcaddressUSDC token address
_userPooladdressUserPool address
_hedgerPooladdressHedgerPool address
_aaveVaultaddressAave vault address
_stQEUROaddressstQEURO token address
_timelockaddressTimelock contract address
_treasuryaddressTreasury address

updateYieldDistribution

Update yield distribution according to pool balances

Recalculates and updates yield distribution based on current pool balances

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

addYield

Add new yield to be distributed

Adds new yield from various sources to the distribution 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 addYield(uint256 yieldAmount, bytes32 source) external;

Parameters

NameTypeDescription
yieldAmountuint256Yield amount in USDC equivalent
sourcebytes32Source identifier (e.g., "aave", "fees")

claimUserYield

Claim pending yield for a user

Claims all pending yield for a specific user from the user 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 claimUserYield(address user) external returns (uint256 yieldAmount);

Parameters

NameTypeDescription
useraddressAddress of the user

Returns

NameTypeDescription
yieldAmountuint256Yield amount claimed

claimHedgerYield

Claim pending yield for a hedger

Claims all pending yield for a specific hedger from the hedger 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 claimHedgerYield(address hedger) external returns (uint256 yieldAmount);

Parameters

NameTypeDescription
hedgeraddressAddress of the hedger

Returns

NameTypeDescription
yieldAmountuint256Yield amount claimed

getCurrentYieldShift

Current yield shift percentage (bps)

Returns the current yield shift percentage 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 getCurrentYieldShift() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Current yield shift percentage in basis points

getUserPendingYield

Pending yield amounts

Returns the amount of pending yield for a specific 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 getUserPendingYield(address user) external view returns (uint256);

Parameters

NameTypeDescription
useraddressAddress of the user

Returns

NameTypeDescription
<none>uint256Pending yield amount for the user

getHedgerPendingYield

Pending yield amounts

Returns the amount of pending yield for a specific hedger

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

Parameters

NameTypeDescription
hedgeraddressAddress of the hedger

Returns

NameTypeDescription
<none>uint256Pending yield amount for the hedger

getTotalYieldGenerated

Total yield generated to date

Returns the total amount of yield generated since inception

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

Returns

NameTypeDescription
<none>uint256Total yield generated amount

getYieldDistributionBreakdown

Yield distribution breakdown

Returns the current yield allocation breakdown between users and hedgers

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 getYieldDistributionBreakdown() external view returns (uint256 userAllocation, uint256 hedgerAllocation);

Returns

NameTypeDescription
userAllocationuint256Current allocation to users
hedgerAllocationuint256Current allocation to hedgers

getPoolMetrics

Current pool metrics

Returns current pool size metrics and ratios

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 userPoolSize, uint256 hedgerPoolSize, uint256 poolRatio);

Returns

NameTypeDescription
userPoolSizeuint256User pool size
hedgerPoolSizeuint256Hedger pool size
poolRatiouint256Ratio (bps) user/hedger

calculateOptimalYieldShift

Calculate optimal yield shift based on current metrics

Calculates the optimal yield shift based on current pool 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 calculateOptimalYieldShift() external view returns (uint256 optimalShift, uint256 currentDeviation);

Returns

NameTypeDescription
optimalShiftuint256Optimal shift (bps)
currentDeviationuint256Current deviation from optimal

getYieldSources

Yield source amounts

Returns yield amounts from different sources

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 getYieldSources()
    external
    view
    returns (uint256 aaveYield, uint256 protocolFees, uint256 interestDifferential, uint256 otherSources);

Returns

NameTypeDescription
aaveYielduint256Aave yield amount
protocolFeesuint256Protocol fees amount
interestDifferentialuint256Interest differential amount
otherSourcesuint256Other sources amount

getHistoricalYieldShift

Historical yield shift statistics for a period

Returns historical yield shift statistics for a specified time 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 getHistoricalYieldShift(uint256 period)
    external
    view
    returns (uint256 averageShift, uint256 maxShift, uint256 minShift, uint256 volatility);

Parameters

NameTypeDescription
perioduint256Time period in seconds

Returns

NameTypeDescription
averageShiftuint256Average shift over period
maxShiftuint256Maximum shift over period
minShiftuint256Minimum shift over period
volatilityuint256Volatility measure

getYieldPerformanceMetrics

Yield performance metrics

Returns comprehensive yield performance 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 getYieldPerformanceMetrics()
    external
    view
    returns (
        uint256 totalYieldDistributed_,
        uint256 averageUserYield,
        uint256 averageHedgerYield,
        uint256 yieldEfficiency
    );

Returns

NameTypeDescription
totalYieldDistributed_uint256Total distributed
averageUserYielduint256Average user yield
averageHedgerYielduint256Average hedger yield
yieldEfficiencyuint256Yield efficiency percentage

setYieldShiftParameters

Update yield shift parameters

Allows governance to update yield shift 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 setYieldShiftParameters(uint256 _baseYieldShift, uint256 _maxYieldShift, uint256 _adjustmentSpeed) external;

Parameters

NameTypeDescription
_baseYieldShiftuint256Base allocation (bps)
_maxYieldShiftuint256Max allocation (bps)
_adjustmentSpeeduint256Adjustment speed (bps)

setTargetPoolRatio

Set the target pool ratio (bps)

Sets the target ratio between user and hedger pools

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 setTargetPoolRatio(uint256 _targetPoolRatio) external;

Parameters

NameTypeDescription
_targetPoolRatiouint256Target ratio

authorizeYieldSource

Authorize a yield source for specific yield type

Authorizes a yield source for a specific type of yield

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 authorizeYieldSource(address source, bytes32 yieldType) external;

Parameters

NameTypeDescription
sourceaddressAddress of the yield source
yieldTypebytes32Type of yield this source is authorized for

revokeYieldSource

Revoke authorization for a yield source

Revokes authorization for a yield source

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 revokeYieldSource(address source) external;

Parameters

NameTypeDescription
sourceaddressAddress of the yield source to revoke

isYieldSourceAuthorized

Check if an address is authorized for a specific yield type

Checks if an address is authorized for a specific yield type

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 isYieldSourceAuthorized(address source, bytes32 yieldType) external view returns (bool);

Parameters

NameTypeDescription
sourceaddressAddress to check
yieldTypebytes32Yield type to check

Returns

NameTypeDescription
<none>boolTrue if authorized

updateYieldAllocation

Update yield allocation for a participant

Updates yield allocation for a specific participant

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 updateYieldAllocation(address user, uint256 amount, bool isUser) external;

Parameters

NameTypeDescription
useraddressAddress of participant
amountuint256Amount to add/subtract
isUserboolTrue if user pool, false if hedger pool

emergencyYieldDistribution

Emergency manual yield distribution

Performs emergency manual yield distribution bypassing normal logic

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 emergencyYieldDistribution(uint256 userAmount, uint256 hedgerAmount) external;

Parameters

NameTypeDescription
userAmountuint256Amount to users
hedgerAmountuint256Amount to hedgers

pauseYieldDistribution

Pause yield distribution operations

Emergency function to pause all yield distribution 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 pauseYieldDistribution() external;

resumeYieldDistribution

Resume yield distribution operations

Resumes yield distribution 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 resumeYieldDistribution() external;

getYieldShiftConfig

YieldShift configuration snapshot

Returns current yield shift 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 getYieldShiftConfig()
    external
    view
    returns (uint256 baseShift, uint256 maxShift, uint256 adjustmentSpeed_, uint256 lastUpdate);

Returns

NameTypeDescription
baseShiftuint256Base shift (bps)
maxShiftuint256Max shift (bps)
adjustmentSpeed_uint256Adjustment speed (bps)
lastUpdateuint256Last update timestamp

isYieldDistributionActive

Whether yield distribution is active (not paused)

Returns true if yield distribution 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 isYieldDistributionActive() external view returns (bool);

Returns

NameTypeDescription
<none>boolTrue if yield distribution is active

checkAndUpdateYieldDistribution

Check if an update to yield distribution is needed and apply if so

Checks if yield distribution needs updating and applies changes if necessary

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

updateLastDepositTime

Update the last deposit time for a user (for TWAP calculations)

Updates the last deposit time for a user, called by user pool on 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 updateLastDepositTime(address user) external;

Parameters

NameTypeDescription
useraddressAddress of the user

forceUpdateYieldDistribution

Force update yield distribution (governance only)

This function allows governance to force an update to yield distribution

Only callable by governance 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 forceUpdateYieldDistribution() external;

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

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;