estarriolvetch / ERC721Psi

MIT License
117 stars 29 forks source link

gas reporting #16

Closed nidhhoggr closed 1 year ago

nidhhoggr commented 1 year ago

I'm going to attempt to start optimizing but there's no gas reporting built in? truffle has a gas reporter, not sure If you've been using something different.

The first thing that needs additional benchmarking is the _mint function so I would like to start adding those tests but a gas reporter is necessary.

nidhhoggr commented 1 year ago

Now I see that you are using scripts to benchmark gas reports. I've also added hardhat-gas-reporting to my branch. The following commit demonstrates optimizations to the mint function using assembly. Optimizations are evident based on the diffs in the reports, all of which show several hundred in savings. I also updated the ERC721A library and the solidity compiler version to 8.17.0.

https://github.com/nidhhoggr/ERC721Psi/commit/752fcd800ca983cb829b5d149345b2f8ce598d0e