executefunction must be used to perform an Inflation operation. This function is public as it can be called by the host or anyone else with an interest in doing so, and requires that the linked extension is active:
earnByAmountsparameter, which is a boolean value representing if the executor's reward is calculated and transferred before (
true) or after (
false) a swap operation. In the first case, the reward is expressed as
input token;in the second, as
executefunction requests from the extension the tokens needed to perform the operation(s) by calling, internally, the
receiveTokensfunction is used (see the Inflation Extension section for more details).
deactivationByFailurefunction on the extension contract. This means that if the extension is not subsequently reactivated by the host, no more operations can be performed in the contract.
lastBlockis updated (set as the execution block) and performs the operation by internally calling the
_executefacilitator function takes as input the
EarnByInputin this case) and the execute
_executefunction handles the type of operation being performed and calculates the token amount operation through the
_calculateTokenAmountfunction. So, depending on whether the operation is a transfer or a swap, it calls the appropriate function that takes care of it: