Closed sebastiantf closed 5 months ago
Apologies for the very late response here - do you remember if this problem was in the context of using OZ's upgradeable contracts? (Have tentatively labeled it that way)
Yes. I was using OZ's upgradeable contract
Similar experience. I am testing two smart contracts, one a regular ERC721 and another one that is OZ's upgradeable. They are almost identical and the contract name displayed is just the regular ERC721 although every test is being completed.
@CWhits Yes, when a proxy sits in front of a target contract the gas-reporter has to fall back on function selectors alone to figure out what's being called. If there are method name collisions the contract attributions can be incorrect.
In the original version of this plugin (eth-gas-reporter) there was an option to help the reporter navigate proxies but no one used it AFAIK.
Am going to add explicit support for OZ upgradeable in the next major version since it's become much more of an issue. Working on this this month however it will probably not be published in beta before March.
This has been fixed in the latest version (2.0). If you're using OZ's upgrades plugin the reporter will automatically resolve proxied contracts.
Closing but just ping if you continue to have problems with this.
I have two contracts
Campaigns
,CampaignsNativeGaslessClaim
which have almost similar ABIs. The gas report only have separate functions which have different ABIs. The counts for the functions with same ABIs seem to suggest that they're being meshed together instead of staying separate.I have confirmed that all methods are being called on both contracts. Particularly the following methods are not reported for
CampaignsNativeGaslessClaim
:claim
setClaimFee
setTrustedAddress
withdrawCampaign
withdrawTotalClaimFees
createCampaign
has different ABIs on both contracts, so that seem to be reported separately correctly