Quantillon Protocol

TokenLibrary

Git Source

Title: TokenLibrary

Author: Quantillon Labs - Nicolas Bellengé - @chewbaccoin

Library for essential token operations to reduce contract bytecode size

This library provides core token validation functions:

  • Mint and burn parameter validation with supply cap checks
  • Used by QEURO token for secure minting and burning operations

Note: security-contact: team@quantillon.money

Constants

VERSION

Library version (semver); see deployments/{chainId}/versions.json for provenance.

string internal constant VERSION = "1.0.0"

Functions

validateMint

Validates mint parameters

Ensures minting doesn't exceed maximum supply and validates 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: Not protected by a reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Not applicable - no oracle dependency

function validateMint(address to, uint256 amount, uint256 totalSupply, uint256 maxSupply) internal pure;

Parameters

NameTypeDescription
toaddressAddress to mint to
amountuint256Amount to mint
totalSupplyuint256Current total supply
maxSupplyuint256Maximum supply cap

validateBurn

Validates burn parameters

Ensures sufficient balance and validates parameters for burning

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: Not protected by a reentrancy guard

  • access: Restricted to authorized roles

  • oracle: Not applicable - no oracle dependency

function validateBurn(address from, uint256 amount, uint256 balance) internal pure;

Parameters

NameTypeDescription
fromaddressAddress to burn from
amountuint256Amount to burn
balanceuint256Current balance