Skip to main content

JBFees

Git Source

Fee calculations.

Functions​

feeAmountResultingIn​

Returns the amount of tokens to pay as a fee relative to the specified amount.

function feeAmountResultingIn(uint256 amountAfterFee, uint256 feePercent) internal pure returns (uint256);

Parameters

NameTypeDescription
amountAfterFeeuint256The amount that the fee is based on, as a fixed point number.
feePercentuint256The fee percent, out of JBConstants.MAX_FEE.

Returns

NameTypeDescription
<none>uint256The amount of tokens to pay as a fee, as a fixed point number with the same number of decimals as the provided amount.

feeAmountFrom​

Returns the fee that would have been paid based on an amount which has already had the fee subtracted from it.

function feeAmountFrom(uint256 amountBeforeFee, uint256 feePercent) internal pure returns (uint256);

Parameters

NameTypeDescription
amountBeforeFeeuint256The amount that the fee is based on, as a fixed point number with the same amount of decimals as this terminal.
feePercentuint256The fee percent, out of JBConstants.MAX_FEE.

Returns

NameTypeDescription
<none>uint256The amount of the fee, as a fixed point number with the same amount of decimals as this terminal.