Giter Site home page Giter Site logo

0xpolarzero / optimize-dependencies Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 368 KB

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

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

License: MIT License

JavaScript 1.73% TypeScript 97.66% CSS 0.61%

optimize-dependencies's Introduction

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

optimize-dependencies's People

Contributors

0xpolarzero avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.