beforeAgreementcallback will be run before the call to the agreement contract will be run. For example, if there is logic inside of the
beforeAgreementCreatedcallback within of a Super App, and a user opens a stream into that Super App contract, the logic inside of
beforeAgreementCreatedwill run before the stream is created.
afterAgreementcallback will be run after the call to the agreement contract is run. For example, if there is logic inside of the
afterAgreementCreatedcallback within a Super App, and a user opens a stream into that Super App contract, the logic inside of
afterAgreementCreatedwill run after the stream is created.
beforeAgreementcallbacks is that they are
viewfunctions. So, if you want to, for example, save a variable to state in response to something that happens in the
beforeAgreementcallback, you should do the following:
beforeAgreementcallback (this returned value will be passed to the
cbdata, which we explain below)
ISuperToken- the protocol will pass the Super Token that's being used in the call to the constant flow agreement contract here.
address- this will be the address of the Constant Flow Agreement contract on the network you're interacting with. You can find more details around these networks inside of the Superfluid network directory.
agreementId- a bytes32 value that is a hash of the sender and receiver's address of the flow that was created, updated, or deleted.
agreementData- the address of the sender and receiver of the flow that was created, updated, or deleted - encoded using solidity's
abi.encode()built in function
cbdata- this contains data that was returned by the
beforeAgreementcallback if it was run prior to the calling of
afterAgreementcallback. Note: this is only passed to the
ctx- this contains data about the call to the constant flow agreement contract itself. 'Ctx' is short for 'context' and is explained in depth inside of our tutorial on userData (which you can access inside of the