0xpolarzero / optimize-dependencies

A basic solution to find better optimized dependencies for a Solidity smart contract.

Home Page:https://optimize-dependencies.vercel.app

Repository from Github https://github.com0xpolarzero/optimize-dependenciesRepository from Github https://github.com0xpolarzero/optimize-dependencies

optimize_deps

A basic solution to find better optimized dependencies for a Solidity smart contract, as well as a few basic best practices for saving gas.

IMAGE

Design forked and modified from 5/9's website.

Features

Input Output Details
OpenZeppelin dependency Solady alternative (if it exists) Imports diff, links, description, updated contracts, audits
Solmate dependency Solady alternative (if it exists) Imports diff, links, description, updated contracts, audits
Openzeppelin Multicall Solady Multicaller Imports diff, links, description, updated contracts, audits
ERC721 batch operations Advice and mock mitigation Imports diff, links, description, updated contracts, audits
Events emitted inside loops Advice and mock mitigation Code diff, basic modification
Airdrop pattern Advice and alternative Mitigation, link to alternative method (Gaslite Drop)
Thirdweb contracts Advice and alternative (?) Mitigation, template for alternative method (?)

TODO

  • Support Openzeppelin
  • Support Solmate
  • Support multicall contracts (find mostly used implementations) => recommend https://github.com/Vectorized/multicaller
  • Recognize events emitted inside loops, recommend {Event}Batch outside
  • Recognize multicall function inside the contract as well
  • Consider this for ERC721 batch operations (need to run benchmarks with Solady)
  • Pattern matching: recognize some kind of airdrop pattern => recommend an optimized solution (Gaslite drop)
  • Thirdweb contracts (e.g. DropERC20Token): do you really need all this? recommend a simpler solution (maybe provide some templates??)
  • Provide some gas benchmarks diff for each replaced contracts (e.g. OZ ERC20 => Solady ERC20 ~x% gas savings, with links)

Replace when branding is done

About

A basic solution to find better optimized dependencies for a Solidity smart contract.

https://optimize-dependencies.vercel.app

License:MIT License


Languages

Language:TypeScript 97.7%Language:JavaScript 1.7%Language:CSS 0.6%