Quantillon Protocol

AdminFunctionsLibrary

Git Source

Title: AdminFunctionsLibrary

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Library for rarely used admin functions to reduce contract size

Main characteristics:

  • Consolidates admin functions like recoverToken
  • Reduces contract size by moving rarely used functions to library
  • Maintains same API and behavior
  • Uses custom errors for gas efficiency

Note: security-contact: team@quantillon.money

Functions

recoverToken

Recover tokens to treasury address

Emergency function to recover ERC20 tokens sent to the contract

Notes:

  • security: Requires admin role

  • validation: None required

  • state-changes: Transfers tokens from contract to treasury

  • events: Emits TokenRecovered event

  • errors: Throws NotAuthorized if caller lacks admin role

  • reentrancy: Not protected - library handles reentrancy

  • access: Restricted to admin role

  • oracle: Not applicable

function recoverToken(address contractInstance, address token, uint256 amount, address treasury, bytes32 adminRole)
    external;

Parameters

NameTypeDescription
contractInstanceaddressThe contract instance calling this function
tokenaddressAddress of the token to recover
amountuint256Amount of tokens to recover
treasuryaddressThe treasury address to send tokens to
adminRolebytes32The admin role required for this operation