Skip to content

IAbstractFeeModule

Author: Originally developed by DEFYCA Labs S.a.r.l., maintained by Nestor Exchange OÜ

Overview

The IAbstractFeeModule interface defines a fee management system for token transfers within the Nestor Protocol, enabling configuration and calculation of transaction fees.

Core Functions

getFeeInfo

function getFeeInfo(bytes32 feeKey_) external view returns (FeeInfo memory);

getFeeInBps

function getFeeInBps(bytes32 tokenFeeKey_) external view returns (uint256);

getFeeRecipient

function getFeeRecipient(bytes32 tokenFeeKey_) external view returns (address);

calculateFeeAmount

function calculateFeeAmount(uint256 tokensAmount_, uint256 feeInBps_) external pure returns (uint256 feeAmount_);

Data Structure

FeeInfo

struct FeeInfo {
    uint256 feeInBps;
    address feeRecipientAddr;
}

Events

NestorFeeSet

event NestorFeeSet(bytes32 indexed feeKey, FeeInfo feeInfo);

Errors

Error Trigger
AbstractFeeModuleInvalidFeeRecipient Zero address recipient provided
AbstractFeeModuleInvalidFee Fee basis points outside acceptable range