Implements the tokenomics algorithm.
Process the FCT return struct (from the FCT_Engine) and returns payers and payees for the FCT_Actuator to use.

Main Functions


function setFeesAndShares(
uint16 baseFeesBPS,
uint16 bonusFeesBPS,
uint16 forFreeFeesBPS,
uint16 activatorShare,
uint16 builderShare,
uint16 officialBuilderShare
) external onlyRole(DAO_ROLE)
Defines activation fees and payment split between the activator and the FCT builder.


function calcPayments(
PaymentIn memory paymentIn,
bytes32 id,
bytes memory data
returns (
Payment[] memory paymentsOut,
address builderOut,
bytes32 nameHashOut
Calculates all fees for an FCT. Aggregates payments by adjacent payers. Returns a list of payers, effective gas for each one of them that represents the cumulative cost (base+fee+bonus), builder and activator shares, and the builder identity.


function estimateExtraCommonGas(
uint256 totalCalls,
uint256 dataLength,
address kiroFunding
) external pure returns (uint256)
Returns the estimated gas for doing the actual payments, so it can be added to in advance to payers fees.