withdrawMax and withdrawMaxAndTransfer do not return the withdrawn amount. In light of the need for improved integration with other Defi contracts it would be useful for them to have the withdrawn amount returned so as to not need an upfront call to withdrawableAmountOf in order for internal accounting to be correctly processed. In case Defi projects would stream to recipients the same applies to cancelMultiple and cancel where the amount refunded has to be queried with refundableAmountOf upfront.
Recommendation
Consider returning the withdrawn amount for withdrawMax and withdrawMaxAndTransfer . The other withdraw don't need this as the amounts are specified as input. Also consider returning the refunded amount for cancelMultiple and cancel
@PaulRBerg tagging to ask for objections before starting working on this
Recommendations made on the latest audit: https://cantina.xyz/code/9566f0dd-9be2-4f02-8135-aed3411902ba/findings/3
Pasting here OP:
Description
withdrawMax
andwithdrawMaxAndTransfer
do not return the withdrawn amount. In light of the need for improved integration with other Defi contracts it would be useful for them to have the withdrawn amount returned so as to not need an upfront call towithdrawableAmountOf
in order for internal accounting to be correctly processed. In case Defi projects would stream to recipients the same applies to cancelMultiple and cancel where the amount refunded has to be queried withrefundableAmountOf
upfront.Recommendation
Consider returning the withdrawn amount for withdrawMax and withdrawMaxAndTransfer . The other withdraw don't need this as the amounts are specified as input. Also consider returning the refunded amount for cancelMultiple and cancel
@PaulRBerg tagging to ask for objections before starting working on this