With Context
// Example Super App Callback
function onFlowCreated(
ISuperToken superToken,
address sender,
bytes calldata ctx
) internal override returns (bytes memory /*newCtx*/) {
newCtx = ctx; // `newCtx` is context bytes variable for updating
// ... callback logic
}// We're assuming here that newCtx is what you've named the context bytes
// object that will be updated throughout the callback and returned
// Without user data
token.createFlowWithCtx(
address receiver,
int96 flowRate,
bytes memory ctx // Pass in the context bytes variable for updating here
) returns (bytes memory);
// these functions look very similar for updates and deletions
token.updateFlowWithCtx(address receiver, int96 flowRate, bytes memory ctx) returns (bytes memory);
token.deleteFlowWithCtx(address sender, address receiver, bytes memory ctx) returns (bytes memory);
// ACL functions also need to be called with context if called in a callback
function createFlowFromWithCtx(
ISuperToken token,
address sender,
address receiver,
int96 flowRate,
bytes memory ctx
) internal returns (bytes memory newCtx)
function updateFlowFromWithCtx(
ISuperToken token,
address sender,
address receiver,
int96 flowRate,
bytes memory ctx
) internal returns (bytes memory newCtx)
function deleteFlowWithCtx(
ISuperToken token,
address sender,
address receiver,
bytes memory ctx
) internal returns (bytes memory newCtx)
function setFlowPermissionsWithCtx(
ISuperToken token,
address flowOperator,
bool allowCreate,
bool allowUpdate,
bool allowDelete,
int96 flowRateAllowance,
bytes memory ctx
) internal returns (bytes memory newCtx)
function setMaxFlowPermissionsWithCtx(
ISuperToken token,
address flowOperator,
bytes memory ctx
) internal returns (bytes memory newCtx)
function revokeFlowPermissionsWithCtx(
ISuperToken token,
address flowOperator,
bytes memory ctx
) internal returns (bytes memory newCtx)Last updated