You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function min(uintx, uinty) purereturns (uint) {
return x < y ? x : y;
}
Passing --gas-report to Forge doesn't generate a report. The only solution as of now is to wrap my free functions in an intermediary mock contract used specifically for testing.
The text was updated successfully, but these errors were encountered:
@PaulRBerg as described in the book, gas reporting traces the external contract calls. since free functions act as internal functions, we cannot correctly identify calls to them.
theoretically, we could record the jumps within each call, but 1) we wouldn't be able to decode them since free/internal functions are not a part of the artifacts 2) encountering a jump doesn't necessarily mean we've entered the internal function 3) that'd produce a lot of data which imo would dilute the value of gas reports
Thanks for explaining the difficulties of implementing this, @rkrasiuk.
I wonder if the user could somehow help Forge identify the functions that should be metered? e.g. what if there was a field in the Foundry config like meter_free_functions or gas_reports_free_functions (or something along those lines)? Would that help in any way?
Component
Forge
Describe the feature you would like
I would like to have gas reports for free functions, e.g.
Passing
--gas-report
to Forge doesn't generate a report. The only solution as of now is to wrap my free functions in an intermediary mock contract used specifically for testing.The text was updated successfully, but these errors were encountered: