authorizeTokenAccess() :
This function is used to authorize access to a Superfluid Token. It requires that the sender of the message is the host of the token, and that the context (ctx) provided is valid. If both of these conditions are met, the function will decode the context and return it as an ISuperfluid.Context memory. (autogenerated documentation)
createCallbackInputs(address,bytes32) :
This function creates a CallbackInputs memory object, which is used to store data related to a callback. The function takes in four parameters: an ISuperfluidToken token, an address account, a bytes32 agreementId, and a bytes memory agreementData. It then assigns the parameters to the corresponding fields in the CallbackInputs memory object and returns the object. (autogenerated documentation)
callAppBeforeCallback() :
This function is used to call an app before a callback is executed. It takes in a set of inputs, including the account of the app, the token, the agreement ID, the agreement data, and the noop bit. It then checks if the app is a SuperApp and not jailed. If so, it pushes the callback stack and encodes the data into a callData variable. It then calls the app before the callback is executed, passing in the callData, a boolean indicating if the noop bit is equal to the BEFORE_AGREEMENT_TERMINATED_NOOP, and the app context. Finally, it pops the callback stack. (autogenerated documentation)
callAppAfterCallback() :
This function is used to call an app after a callback has been triggered. It takes in three parameters: CallbackInputs memory inputs, bytes memory cbdata, and bytes memory ctx. It returns an ISuperfluid.Context memory appContext and bytes memory newCtx. The function first checks if the app is a SuperApp and if it is not jailed. If it is, it pushes the callback stack and checks if the noopBit matches the inputs.noopBit. If it does, it encodes the call data and calls the app after the callback. It then decodes the context and adjusts the app credit used. Finally, it pops the callback stack and returns the appContext and (autogenerated documentation)
_adjustNewAppCreditUsed(uint256,int256) :
This function adjusts the amount of app credit used when a new app is created. It takes two parameters, the amount of app credit granted and the delta of the app callback deposit, and returns the amount of app credit used. The function works by first ensuring that the amount of app credit used is not negative, and then returning the minimum of the app credit granted and the delta of the app callback deposit. (autogenerated documentation)
_selectorFromNoopBit(uint256) :
This function is used to select the appropriate selector from a given noopBit. It takes in a uint256 noopBit as an argument and returns a bytes4 selector. The function uses an if-else statement to check the value of the noopBit and returns the corresponding selector. If the noopBit is equal to SuperAppDefinitions.BEFORE_AGREEMENT_CREATED_NOOP, the function returns ISuperApp.beforeAgreementCreated.selector. Similarly, if the noopBit is equal to SuperAppDefinitions.BEFORE_AGREEMENT_UPDATED_NOOP, the function returns ISuperApp.beforeAgreementUpdated.selector and so on. (autogenerated documentation)
_pushCallbackStack() :
This function is used to push a callback onto the callback stack. It takes in a context (ctx) and a set of inputs (inputs) and returns an application context (appCtx). The context is used to store the state of the application, while the inputs are used to provide information about the account, the amount of credit granted, the amount of credit used, and the token associated with the transaction. The function then calls the appCallbackPush function of the ISuperfluid contract, passing in the context, the account, the credit granted, the credit used, and the token. This function will then add the callback to the callback stack, allowing the application to be notified when the transaction is complete. (autogenerated documentation)
_popCallbackStack(int256) :
This function is a private function that is part of the ISuperfluid contract. It is used to pop the callback stack, which is a data structure used to store information about the current state of the contract. The function takes two parameters, a bytes memory ctx and an int256 appCreditUsedDelta. The ctx parameter is used to store the current state of the contract, while the appCreditUsedDelta parameter is used to track the amount of app credits used by the contract. The function then calls the appCallbackPop() function from the ISuperfluid contract, passing in the ctx and appCreditUsedDelta parameters. The function then returns a bytes memory newCtx, which is the updated state of the contract (autogenerated documentation)
max(int256,int256) :
This function is an internal pure function that takes two int256 values (a and b) as parameters and returns the larger of the two values. It does this by comparing the two values and returning the larger one using an if-else statement. (autogenerated documentation)
max(uint256,uint256) :
This function is an internal pure function that takes two uint256 values (unsigned integers of 256 bits) as parameters and returns the larger of the two values. It does this by comparing the two values and returning the larger one. (autogenerated documentation)
min(int256,int256) :
This function is an internal pure function that takes two int256 values (a and b) as parameters and returns the smaller of the two values. It works by comparing the two values and returning the smaller one. If a is greater than b, it returns b, otherwise it returns a. (autogenerated documentation)