IDAv1Libraryis to abstract the code required to call an agreement. Below is a comparative example of how an index might be created with and without the library.
IDAv1Libraryinto scope from the
@superfluid-financepackage for Ethereum contracts.
InitData. This struct is defined in the library as follows.
InitDatastruct, then we create a local state variable called
idaaddresses passed into the constructor.
WithCtxat the end of it. For example, instead of creating an index in a callback with
createIndex, you should use
createIndexWithCtxand return the result,
newCtx, of type
InitDatastruct is named
WithCtxfunction shown in the Callback Usage section above.
WithCtxfunction to include arbitrary user data.
distribute, except here you must specify the new total index value in the
indexValueparameter. This fails if it is not greater than the last index value.
updateIndexValue, but instead of having to specify the new
indexValue, you can pass an
amountby which the
indexValueshould be incremented. This is simply another way to distribute tokens.