Add memory side effects notes when using function pointers (#5174)

Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Ernesto García
2024-08-30 05:44:05 -06:00
committed by Hadrien Croubois
parent 0f09ebad09
commit aba42a07da
4 changed files with 14 additions and 0 deletions

View File

@ -26,6 +26,8 @@ const sort = type => `\
* array. Using it in view functions that are executed through \`eth_call\` is safe, but one should be very careful
* when executing this as part of a transaction. If the array being sorted is too large, the sort operation may
* consume more gas than is available in a block, leading to potential DoS.
*
* IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.
*/
function sort(
${type}[] memory array,