Skip to content

In this panel, you will learn how to approach gas optimizations in a more efficient way. This includes ways to learn about gas optimization, how to advertise yourself as a gas optimizer, and the tooling and resources available.

Notifications You must be signed in to change notification settings

Laugharne/gas_optimization_panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

This is a transcription of a YouTube video. Among the relevant resources for learning more about EVM and gas optimisation, I found this video particularly interesting.

This content presents the opinions and perspectives of industry experts or other individuals.   The opinions expressed in this content do not necessarily reflect my opinion.

Readers are encouraged to verify the information on their own and seek professional advice before making any decisions based on this content.

In this panel, you will learn how to approach gas optimizations in a more efficient way. This includes ways to learn about gas optimization, how to advertise yourself as a gas optimizer, and the tooling and resources available.

  • 00:00:25 How Ded and Arz Got Started with Web3
  • 00:02:10 The Goal of Gas Optimization
  • 00:06:50 How to Get Better at Gas Optimization
  • 00:09:10 EVM Puzzle Game
  • 00:10:50 Building Your Own EVM from Scratch
  • 00:12:45 ERC721A
  • 00:15:00 Optimization Strategy
  • 00:17:00 How to Write a Gas-Optimized Contract
  • 00:20:30 How to Audit for Gas Optimizations
  • 00:24:30 The Current State of Gas Optimization and What the Future Holds
  • 00:27:50 How to Do Gas-Optimization Reports
  • 00:30:50 What Happens with Gas Optimization as Ethereum Scales
  • 00:33:30 Gas Optimization Tools
  • 00:36:20 Using HUFF in Production
  • 00:39:00 The Best Way to Deal with Gas Optimizations as a Researcher
  • 00:43:00 Advertising Yourself as a Gas Optimizer
  • 00:45:00 The Coolest Gas-Optimization Technique

00:00 Introduction and Background

Section Overview: In this section, the speakers introduce themselves and discuss their backgrounds in mathematics, data science, AI, and web development. They also mention their motivations for learning gas optimization.

Background of the Speakers

  • The first speaker has a background in mathematics, with a focus on data science and AI. They are currently working on their dissertation in applied math.
  • The second speaker started programming six years ago, beginning with Python and later learning JavaScript and web development. They transitioned to web3 two years ago and have been working on smart contracts and auditing.

01:27 Learning Gas Optimization

Section Overview: The speakers share their journeys of learning gas optimization and provide insights into how others can learn it as well.

Speaker 1's Journey

  • Speaker 1 decided to learn gas optimization when ERC20 first came out, as it became important to optimize gas usage.
  • They started by understanding how events work and gradually learned more about optimizing gas usage.
  • Speaker 1 took a course on gas optimization, read articles, watched videos, and spent time debugging transactions in Remix to gain practical knowledge.
  • They also explored EVM codes playground, solved EVM puzzles, studied code of protocols, and learned about Yul.

Speaker 2's Journey

  • Speaker 2 initially approached gas optimization as an investor who realized its significance for protocol participation.
  • They started by creating a Twitter account to share their learnings about gas optimization.
  • Speaker 2 taught themselves through documentation resources like ChatGPT.
  • Initially made some incorrect posts but continued learning from mistakes.

05:19 Conclusion

Section Overview: The speakers conclude the discussion on their journeys of learning gas optimization.

Key Takeaways

  • Gas optimization is crucial for developers and investors in the web3 space.
  • Learning gas optimization involves practical experience, studying code, debugging transactions, and exploring resources like courses and puzzles.
  • Sharing knowledge through platforms like Twitter can help others learn about gas optimization.

Note: The transcript does not provide timestamps beyond this point.

06:34 Understanding the Ethereum Virtual Machine (EVM)

Section Overview: In this section, the speaker discusses the importance of understanding how the Ethereum Virtual Machine (EVM) works and provides tips on learning about its components.

Learning about the EVM

  • 06:52 It is crucial to learn how the event works and understand where information is stored, what bytecode and opcodes are, and what a function dispatcher is.
  • 07:17 Understanding the EVM can be challenging but essential for security and gas optimization. It requires transitioning from a web 2 mindset and realizing that code execution happens in blocks.
  • 08:16 To gain a deep understanding of how the EVM works, it is recommended to use tools like Remix and EVM Codes. These tools allow stepping through opcodes and help identify gas costs.
  • 09:00 Another useful resource for learning about the EVM is EVM Puzzles, which offers interactive challenges to solve using correct call data values to prevent function reversion.

Tips and Tricks for Gas Optimization

  • 11:54 There are various tips and tricks for optimizing gas usage in Solidity contracts. Caching array length can be one example.
  • 12:14 Practicing different approaches used by experienced developers can help improve gas efficiency.

12:43 Gas Efficiency in ERC721 Contracts

Section Overview: The speaker discusses gas efficiency in ERC721 contracts compared to classic NFT contracts.

  • 12:43 The speaker mentions CRC721a as an example of an ERC721 contract that achieved significant gas savings compared to a classic NFT contract based on OpenZeppelin's implementation.

13:30 Gas Optimization for Smart Contracts

Section Overview: In this section, the speaker discusses gas optimization techniques for smart contracts, particularly in projects with a large number of users. They mention the efficiency of ERC-721 and ERC-721a standards, as well as the importance of learning how to access EVM's financials to eliminate unnecessary gas costs.

Gas Optimization Techniques

  • 13:47 Consider the gas efficiency of different token standards like ERC-721 and ERC-721a when dealing with batch minting or large numbers of users.
  • 14:13 Learn how to access EVM's financials to eliminate unnecessary gas costs and optimize code.
  • 14:49 Focus on continuous learning and exploring different gas optimization techniques.
  • 15:25 Be aware that automated bots can find common optimizations like caching array length or unchecked transfers, so focus on more creative optimizations that bots may not catch.
  • 16:01 Look for redundancies in code, potential bit shifts, and other opportunities for optimization by understanding what the code does.

17:00 Writing Gas Optimized Contracts

Section Overview: This section focuses on strategies for writing gas optimized contracts. The speaker emphasizes starting with an efficient architecture, doing more of what is cheap and less of what is expensive, searching for tips and tricks (that may not be caught by bots), and always testing and benchmarking.

Strategies for Writing Gas Optimized Contracts

  • 17:34 Start with an efficient architecture that minimizes data stored on-chain to reduce expensive storage operations.
  • 18:29 Organize your code to prioritize cheaper operations over expensive ones using salinity (memory usage) and assembly (eliminating redundant codes).
  • 19:15 Search for tips and tricks that can be manually implemented, such as pre-incrementing variables.
  • 19:37 Always test and benchmark your code to identify areas for improvement and rewrite accordingly.

Note: The transcript is already in English, so there is no need to translate the headings or content.

20:16 Pre-increment and Contract Development

Section Overview: The speaker discusses the benefits of using pre-increment in contract development to find more efficient ways of coding. They emphasize the importance of continuously improving contracts.

Using Pre-increment for Efficient Contract Development

  • Pre-increment can help in finding more efficient ways of coding contracts.
  • Continuously improving contracts leads to better optimization over time.

20:35 Auditing Contracts for Gas Optimization

Section Overview: The speaker introduces the topic of auditing contracts for gas optimization and shares insights on the auditing process.

Auditing Process for Gas Optimization

  • Auditing processes may vary from person to person.
  • Understanding the protocol is a key aspect of auditing.
  • Reading code, documentation, and engaging with the community helps in understanding the protocol.
  • Gas optimizations should be based on a thorough understanding of the protocol.
  • Writing a comprehensive report is crucial for submitting audit findings.

23:12 Gas Optimization Strategies

Section Overview: The speakers discuss strategies for gas optimization during contract development and auditing.

Strategies for Gas Optimization

  • Identifying areas where instantiations occur multiple times or bit shifting can be used.
  • Rewriting code can lead to significant gas savings.
  • Benchmarking different approaches helps identify more efficient solutions.
  • Writing a detailed report with explanations, recommendations, and quantified gas savings is important.

24:48 Current State and Future of Gas Optimization

Section Overview: The speakers discuss the current state of gas optimization and its future prospects.

Current State and Challenges

  • Gas optimization is a relatively new field but gaining attention.
  • Readability concerns sometimes hinder gas optimizations in projects.
  • Limited financial incentives may discourage developers from prioritizing gas optimizations.
  • Private auditors and individuals are emerging to address the need for gas optimization.

25:26 Collaborative Efforts in Gas Optimization

Section Overview: The speakers discuss the importance of collaborative efforts in gas optimization and highlight the role of rewriting code.

Collaborative Approach to Gas Optimization

  • Gas optimizations can come from various sources, not just individual developers.
  • Rewriting code is a common approach to achieve significant gas savings.
  • Care must be taken to ensure security and avoid introducing bugs during code rework.

Note: The transcript provided does not include timestamps for some sections.

Section Overview: In this section, the speaker discusses the optimization of protocols and the potential convergence of various protocols in the future.

Will we see more protocols being optimized? (t=1593s)

  • The speaker believes that as mainstream adoption of blockchain technology increases, it is inevitable that more protocols will be optimized.
  • As adoption grows, there may be a coalescence of protocols where many will converge or be pushed aside.
  • Protocols that are left standing will need to optimize to stay relevant.

Section Overview: This section explores whether developers will need to worry about optimizing their code when Ethereum scales.

Will developers have to worry about optimizing their code when Ethereum scales? (t=1650s)

  • It is uncertain whether developers will need to optimize their code when Ethereum scales.
  • The question arises because as Ethereum scales, transaction computation power becomes crucial. Functions with higher gas costs limit what can be done in a single transaction.
  • Some argue that using layer 2 chains can eliminate the need for gas optimization, but transaction computation power remains a factor.

Section Overview: The speaker addresses ways for newcomers to perform gas optimization reports and qualitative analysis reports.

Ways for newcomers to perform gas optimization and qualitative analysis reports (t=1675s)

  • Code Arena and Health Finance are platforms where users can submit gas optimization reports and earn rewards.
  • To start, it is important to understand the particle (code) and identify areas that can be rewritten into a cheaper way.
  • Learning what is cheap and expensive in terms of gas usage is crucial. Benchmarking and testing different approaches can help determine what works best.
  • Line-by-line analysis of code can reveal opportunities for optimization.

Section Overview: The speaker emphasizes the importance of using markdown for note-taking and organization during gas optimization.

Importance of using markdown for gas optimization (t=1787s)

  • Markdown is a helpful tool for organizing notes and keeping track of gas optimization reports.
  • Gas optimization can become overwhelming, but having an organized pre-report can make the process easier.
  • Proper documentation helps avoid confusion and ensures a thorough job in gas optimization.

Section Overview: The speaker discusses the need for code optimization even if layer 2 chains are used.

Need for code optimization despite layer 2 chains (t=1879s)

  • Even with the use of layer 2 chains, developers will still need to optimize their code.
  • Transaction computation power remains a factor, and functions with high gas costs limit what can be done in a single transaction.

Section Overview: The speaker explores how current optimizers are compensating for Solidity's mistakes and anticipates future improvements.

Compensation for Solidity's mistakes and future improvements (t=1914s)

  • Current optimizers are seen as compensating for Solidity's mistakes made during Ethereum's development.
  • Future improvements may include features like automatic caching or length calculation to simplify code and reduce gas usage.
  • Anticipation grows for new updates that could enhance gas optimizations, such as push zero or transient storage.

32:45 Gas Optimization Projects

Section Overview: The speaker discusses the need for projects that can help developers optimize their code, specifically focusing on gas optimizations. They mention the lack of tools like Slither for gas optimizations and suggest the idea of a tool that everyone can use.

Gas Optimization Tools

  • There is a need for tools that focus on gas optimizations in addition to security.
  • While there are some existing tools like Foundry and Hardhat, they may not fully address the issue.
  • Creating a tool that automatically fixes gas optimization issues would be challenging.
  • It might be possible to develop a tool similar to fuzzing techniques, but it would still have limitations.
  • The tool would not be able to optimize large amounts of code like an experienced developer could.

34:20 Gas Bounty Platform

Section Overview: The speaker discusses the idea of a gas bounty platform where users can submit gas optimization tips and results. They highlight the importance of motivating protocols to participate in such platforms.

Gas Bounty Platform

  • A gas bounty platform could incentivize users to submit gas optimization tips and results.
  • However, there should be measures in place to prevent submissions of trivial or insignificant tips.
  • Motivating protocols to participate in such platforms might be challenging as it involves cost without immediate benefits.

36:07 Future Use of Huff and Viper

Section Overview: The speakers discuss the potential future use of Huff and Viper languages for smart contract development. They consider the impact on security measures and auditing processes.

Future Use of Huff and Viper

  • There is uncertainty regarding using Huff in production with deployed contracts due to difficulties in verifying contracts written in Huff.
  • Viper has some security features that Solidity lacks, but there are concerns about its impact on security measures and auditing processes.
  • Some protocols may consider rewriting their contracts in Viper or Huff, but it depends on the specific project and its development team.

38:08 Appreciation for Arc and Dead

Section Overview: The speaker expresses gratitude towards Arc and Dead for their tweets and contributions, which have been helpful in understanding Solidity and debugging code.

Appreciation for Arc and Dead

  • The speaker thanks Arc for their tweets that helped them learn about Solidity and improve gas efficiency.
  • They also express gratitude towards Dead for teaching them about smart contract attacks through Twitter posts.
  • Both Arc and Dead are seen as inspirations by the speaker.

39:15 Private Auditing and Gas Optimization

Section Overview: The speaker discusses the concept of private auditing and gas optimization in the context of code contests and protocol audits. They raise questions about the benefits of participating in contests versus performing private audits, as well as the timing of gas optimization in relation to overall code auditing.

Is it better to participate in contests or focus on private audits?

  • Participating in contests may not yield significant rewards due to low payouts and time wasted on gathering gas issues.
  • Private audits offer higher payouts but require delivering real results and ensuring thorough security checks.
  • Starting with code contests on platforms like Code Arena and Sherlock can help gain experience, build reputation, and attract potential clients for private audits.

When should gas optimization be performed during an audit?

  • Performing a gas audit before a security audit is recommended to avoid introducing additional bugs through gas optimizations.
  • Gas optimizations can make it harder to understand the function's purpose, especially when complex algorithms are involved.

44:08 Challenges of Auditing Complex Algorithms

Section Overview: The speaker discusses the challenges faced when auditing complex algorithms implemented on the EVM (Ethereum Virtual Machine). They highlight difficulties in reviewing code written in assembly language and emphasize the importance of having auditors who are knowledgeable about assembly.

Reviewing complex algorithms implemented on EVM

  • Auditing complex algorithms written in assembly language is challenging due to limited expertise among auditors.
  • Some complicated algorithms are inspired by C implementations, making it difficult to review their functionality on the EVM.

Importance of knowledge about assembly language

  • Lack of familiarity with assembly language makes it harder for auditors to effectively review code.
  • Assembly expertise is crucial for understanding and optimizing gas usage efficiently.

45:02 Coolest Gas Optimization Techniques

Section Overview: The speaker shares their favorite gas optimization technique, highlighting the benefits of bit shifting and its application in optimizing code.

Favorite gas optimization technique

  • Bit shifting is considered a cool and effective gas optimization technique.
  • Utilizing bit shifting can lead to significant improvements in code efficiency and gas usage.

Note: The transcript provided does not include timestamps for all sections.

45:42 Understanding Bit Shifting and Gas Optimization

Section Overview: In this section, the speakers discuss bit shifting and its use in type casting and converting different types. They also explore how bit shifting can be used for gas optimization in Ethereum smart contracts.

Bit Shifting for Type Casting and Converting Types

  • Bit shifting is commonly used for type casting to convert different types.
  • Shifting bits allows you to move a bit from one position to another, which is equivalent to multiplying or dividing by two.
  • It can be used for other numbers as well, such as 10 or 100, depending on the specific use case.

Gas Optimization with Bit Shifting

  • Bit shifting can help optimize gas usage in Ethereum smart contracts.
  • By reducing gas consumption, it becomes more cost-effective to execute transactions on the network.
  • However, gas optimization may become less important with the introduction of layer 2 solutions and cheaper transaction fees in the future.

46:59 The Momentary Trend of Gas Optimization

Section Overview: In this section, the speakers discuss the current emphasis on gas optimization due to high network fees. They also consider how this trend may change with the introduction of new layer 2 solutions and lower transaction costs.

Gas Optimization as a Momentary Trend

  • Currently, reducing gas consumption is crucial due to expensive network fees.
  • However, with the development of layer 2 solutions and potential cost reductions in the future, optimizing gas usage may become less significant.

Historical Perspective on Code Optimization

  • Code optimization has always been a consideration throughout history.
  • As hardware advances, certain optimizations become less relevant.
  • While it's possible that computational capacity could increase significantly in the future, optimization will likely remain necessary due to limited resources.

48:30 Closing Thoughts and Appreciation

Section Overview: In this section, the speakers express their gratitude for the discussion and summarize their key takeaways.

Appreciation and Gratitude

  • The speakers thank the audience for their participation and express appreciation for hosting the discussion.
  • They highlight that they have learned a lot from the conversation and hope that others have also gained valuable insights.

Note: The transcript ends here, and no further content is available.

Generated with Video Highlight


Transcript

  • 00:00:00 ➜ so yeah hopefully everyone will learn
  • 00:00:02 ➜ something from this and I'm excited to
  • 00:00:04 ➜ be doing this so get me started
  • 00:00:08 ➜ yes
  • 00:00:09 ➜ daddy want to start
  • 00:00:12 ➜ yeah yeah sure so I have a background in
  • 00:00:15 ➜ mathematics I was really big into you
  • 00:00:18 ➜ know data science and AI I mean I still
  • 00:00:20 ➜ am I'm doing my dissertation in applied
  • 00:00:22 ➜ math so that's my background
  • 00:00:25 ➜ um coming into web 3 right now is a
  • 00:00:29 ➜ decision to kind of get ahead of the
  • 00:00:31 ➜ curve because after my dissertation
  • 00:00:33 ➜ after I have my PhD I wanted to go into
  • 00:00:35 ➜ it full time so you know jumping in a
  • 00:00:39 ➜ little early was my way of getting a
  • 00:00:40 ➜ head start and coming from a
  • 00:00:43 ➜ mathematical background I didn't really
  • 00:00:44 ➜ do much in coding you know like I did a
  • 00:00:47 ➜ lot of coding but uh you know pure
  • 00:00:50 ➜ computer science and so I wanted to dive
  • 00:00:52 ➜ into gas optimization and you know Yule
  • 00:00:55 ➜ and all this assembly and so forth
  • 00:00:56 ➜ because I had no background in it and I
  • 00:00:59 ➜ knew it was a big thing so that's where
  • 00:01:02 ➜ that's where I began
  • 00:01:05 ➜ awesome nice to meet you by the way
  • 00:01:07 ➜ really cool so I'm ours I started with
  • 00:01:10 ➜ programming six years ago I started with
  • 00:01:13 ➜ python which introduced me to
  • 00:01:15 ➜ programming and that I learned
  • 00:01:18 ➜ JavaScript and web development
  • 00:01:20 ➜ spent some time on web 2 as a full stack
  • 00:01:22 ➜ web developer but I knew I wouldn't
  • 00:01:24 ➜ succeed because of the competition
  • 00:01:27 ➜ so I decided to move to weapery which
  • 00:01:29 ➜ was like two years ago probably more and
  • 00:01:32 ➜ yeah I learned solidity and Battery
  • 00:01:34 ➜ development
  • 00:01:35 ➜ and the last year I was just writing
  • 00:01:38 ➜ smart contracts working on some projects
  • 00:01:40 ➜ doing websites too and then I decided to
  • 00:01:44 ➜ learn auditing and lower levels already
  • 00:01:46 ➜ so this year I decided to to transition
  • 00:01:50 ➜ to auditing and started auditing like
  • 00:01:53 ➜ two months ago
  • 00:01:55 ➜ like doing contests and all this stuff
  • 00:01:57 ➜ and you might know me from Twitter where
  • 00:01:59 ➜ I post a lot of cast optimization tricks
  • 00:02:02 ➜ and stuff related to that and today we
  • 00:02:05 ➜ will be talking about it
  • 00:02:06 ➜ so for those that don't know uh the goal
  • 00:02:11 ➜ of optimizing us is to reduce the
  • 00:02:13 ➜ overall number of operations needed to
  • 00:02:16 ➜ run a smart contract
  • 00:02:19 ➜ um the first thing we'll talk about is
  • 00:02:22 ➜ just about our journey how we learn how
  • 00:02:25 ➜ to optimize and how you could learn how
  • 00:02:27 ➜ to optimize so I'll start
  • 00:02:31 ➜ I decided to learn how to optimize when
  • 00:02:34 ➜ I went erc7208 first came out and that's
  • 00:02:38 ➜ when everyone started really caring
  • 00:02:40 ➜ about their gas usage so
  • 00:02:42 ➜ I knew that I had to learn how to
  • 00:02:44 ➜ optimize if I wanted to be a good
  • 00:02:46 ➜ developer and it's just a skill that
  • 00:02:49 ➜ also Lady Death should have because your
  • 00:02:52 ➜ users pay money when they interact with
  • 00:02:55 ➜ your smart contract and just I really
  • 00:02:57 ➜ like what they were doing and at that
  • 00:03:00 ➜ time I initulated it quite well but I
  • 00:03:03 ➜ didn't really know much what is
  • 00:03:05 ➜ happening behind the scenes so I started
  • 00:03:08 ➜ learning how the event works and I
  • 00:03:10 ➜ started to understand more of what is
  • 00:03:12 ➜ happening and what and where you can
  • 00:03:15 ➜ optimize and you know I started small
  • 00:03:18 ➜ and I was writing gas optimized nft
  • 00:03:21 ➜ contracts which is great at that time
  • 00:03:24 ➜ and something new too but you know you
  • 00:03:26 ➜ have to start small and then in summer I
  • 00:03:30 ➜ but the uh Jeffrey Schultz Castle
  • 00:03:34 ➜ compensation course
  • 00:03:36 ➜ and I took the course it was amazing and
  • 00:03:39 ➜ you know I read many articles watched so
  • 00:03:41 ➜ many videos but I learned the most when
  • 00:03:44 ➜ I was just writing some functions in
  • 00:03:46 ➜ remix and just debugging the transaction
  • 00:03:48 ➜ and
  • 00:03:50 ➜ understanding what is being done here
  • 00:03:51 ➜ and just going through the op codes one
  • 00:03:53 ➜ by one understanding what every upgrade
  • 00:03:55 ➜ is doing how this stack is manipulated
  • 00:03:58 ➜ how does membrane starts work and stuff
  • 00:04:00 ➜ like that you know and that's when I
  • 00:04:03 ➜ really started to understand how the
  • 00:04:04 ➜ even works and why something is cheaper
  • 00:04:07 ➜ than the other thing like for example
  • 00:04:09 ➜ the 22 gas difference because of the
  • 00:04:12 ➜ function dispatcher
  • 00:04:14 ➜ and I just understand why for example
  • 00:04:17 ➜ called using call that is cheaper than
  • 00:04:19 ➜ memory and you know I spent a lot of
  • 00:04:22 ➜ time in the evm codes playground just
  • 00:04:24 ➜ understanding how everything works and
  • 00:04:27 ➜ seeing how the values are pushed to the
  • 00:04:29 ➜ stack and stuff like that and then I
  • 00:04:31 ➜ also did the EDM puzzles and the rare
  • 00:04:34 ➜ skills gas puzzles which definitely
  • 00:04:37 ➜ helped me a lot and also reading the
  • 00:04:39 ➜ code of some protocols helped me out too
  • 00:04:42 ➜ so I learned how to optimize in solidity
  • 00:04:45 ➜ but I wanted to go like even deeper so I
  • 00:04:49 ➜ decided to learn new and use not easy
  • 00:04:52 ➜ and I still haven't mastered you I don't
  • 00:04:56 ➜ know how for Viper so I'm still far away
  • 00:04:58 ➜ from being a good Optimizer but I
  • 00:05:01 ➜ definitely plan to learn both and yeah
  • 00:05:02 ➜ that's how I learned how to optimize and
  • 00:05:06 ➜ my my first ever submission of a gas
  • 00:05:09 ➜ report on code Arena ordered me over 200
  • 00:05:12 ➜ which is just great from gas
  • 00:05:14 ➜ optimization so
  • 00:05:16 ➜ so yeah uh that you want to talk about
  • 00:05:19 ➜ your journey and then we will talk about
  • 00:05:20 ➜ how you would learn this if we had to
  • 00:05:22 ➜ start from the beginning
  • 00:05:24 ➜ yeah yeah thank you for that artists
  • 00:05:27 ➜ um yeah so I came into the space as an
  • 00:05:29 ➜ investor to begin with SO gas
  • 00:05:31 ➜ optimization is something that I kind of
  • 00:05:33 ➜ gravitated towards naturally as you know
  • 00:05:36 ➜ it was an investor and you got to spend
  • 00:05:37 ➜ all this gas convincing an nft or or
  • 00:05:40 ➜ whatever and uh I just knew that you
  • 00:05:42 ➜ know it was going to be a big thing for
  • 00:05:45 ➜ specific protocols since you know it it
  • 00:05:47 ➜ actually is a key deciding point for
  • 00:05:50 ➜ some people for a lot of people whether
  • 00:05:51 ➜ they will participate in a protocol or
  • 00:05:53 ➜ not
  • 00:05:54 ➜ and so I knew that it was going to be
  • 00:05:56 ➜ something I wanted to focus on
  • 00:05:58 ➜ how I actually started my journey was
  • 00:06:00 ➜ just making a Twitter you know I just
  • 00:06:02 ➜ made a Twitter and I uh went to chatgpt
  • 00:06:05 ➜ went to all the docs whatever taught
  • 00:06:07 ➜ myself what I could just doing that and
  • 00:06:10 ➜ started making posts and a lot of them
  • 00:06:13 ➜ were wrong you know some of them were
  • 00:06:14 ➜ right but a lot of them were wrong and
  • 00:06:15 ➜ people corrected me and just learned
  • 00:06:17 ➜ along that way and that's actually when
  • 00:06:19 ➜ I met ours
  • 00:06:20 ➜ and that's where I got the you know the
  • 00:06:22 ➜ Big Boost of of this gas optimization
  • 00:06:25 ➜ and he really put me on game for the you
  • 00:06:27 ➜ know like actually like looking into the
  • 00:06:30 ➜ depths of it all and going through these
  • 00:06:32 ➜ op codes and all these playgrounds and
  • 00:06:33 ➜ the debugging and remix and and all of
  • 00:06:36 ➜ that so yeah and then now now I'm here I
  • 00:06:39 ➜ haven't really dived into Yule too much
  • 00:06:40 ➜ I do know
  • 00:06:41 ➜ as I said I have I have been getting
  • 00:06:43 ➜ into it but uh like ours there's a lot
  • 00:06:46 ➜ of room for growth there
  • 00:06:48 ➜ but yeah let's get into uh what
  • 00:06:50 ➜ everybody can do to get a little better
  • 00:06:52 ➜ at this and what's some of the key it's
  • 00:06:54 ➜ really key areas are
  • 00:06:58 ➜ so I think the first step that everyone
  • 00:07:00 ➜ should do is like learn how the event
  • 00:07:02 ➜ works and I think we can agree on this
  • 00:07:05 ➜ just understand where information is
  • 00:07:07 ➜ stored understand what the byte code is
  • 00:07:10 ➜ what op codes are what is a function
  • 00:07:12 ➜ dispatcher and many more other stuff
  • 00:07:14 ➜ right
  • 00:07:17 ➜ definitely I mean I think the biggest
  • 00:07:19 ➜ the biggest thing for me was fully
  • 00:07:22 ➜ understanding what the evm is doing I
  • 00:07:25 ➜ think that was one of the the largest
  • 00:07:27 ➜ hurdles for me especially especially in
  • 00:07:29 ➜ security but you know definitely in gas
  • 00:07:31 ➜ optimization too and they uh coming from
  • 00:07:34 ➜ the background in web 2 a lot of people
  • 00:07:37 ➜ I see it even even in these experienced
  • 00:07:40 ➜ devs
  • 00:07:41 ➜ um they'll be assuming things are are
  • 00:07:43 ➜ changing or whatever you know the
  • 00:07:45 ➜ transaction hasn't been gone through the
  • 00:07:46 ➜ block hasn't been printed and so forth
  • 00:07:48 ➜ and uh it's hard to get out of that
  • 00:07:51 ➜ mindset that you know a line of code is
  • 00:07:52 ➜ ran and something's changed but yeah so
  • 00:07:56 ➜ that was that was my biggest hurdle was
  • 00:07:58 ➜ learning the evm and kind of
  • 00:07:59 ➜ transitioning from that python mindset
  • 00:08:02 ➜ into solidity
  • 00:08:04 ➜ yeah definitely so as I said you know
  • 00:08:07 ➜ radar tools watch videos to read the
  • 00:08:10 ➜ yellow paper but the most important
  • 00:08:12 ➜ thing is that you charge yourself and
  • 00:08:14 ➜ actually step through the up codes
  • 00:08:15 ➜ yourself
  • 00:08:17 ➜ and yeah as I said that's what helped me
  • 00:08:19 ➜ the most and that is when you will
  • 00:08:21 ➜ actually understand how the event works
  • 00:08:23 ➜ and you will be able to tell what a
  • 00:08:27 ➜ function will do well upcult will will
  • 00:08:30 ➜ be used then how much gas will that up
  • 00:08:32 ➜ codes cost and stuff like that so and
  • 00:08:36 ➜ you know once you learn how the even
  • 00:08:38 ➜ works you will just see where gas can be
  • 00:08:40 ➜ saved because you understand how much
  • 00:08:41 ➜ the up codes cost and you will sort of
  • 00:08:44 ➜ have this vision and understand what is
  • 00:08:46 ➜ expensive and what is not
  • 00:08:48 ➜ so I would say two great tools uh remix
  • 00:08:51 ➜ and evm codes just really uh recommend
  • 00:08:55 ➜ everyone trying them
  • 00:08:56 ➜ uh really amazing stuff to actually
  • 00:09:00 ➜ learn how to and see how the EPM works
  • 00:09:03 ➜ and all the op codes and definitely evm
  • 00:09:06 ➜ puzzles uh it's a very cool game where
  • 00:09:10 ➜ you basically have to
  • 00:09:13 ➜ oh where you have to basically uh
  • 00:09:17 ➜ oh you have to pass in the correct value
  • 00:09:21 ➜ or the correct call data so that the
  • 00:09:23 ➜ function doesn't revert and it's it's a
  • 00:09:26 ➜ really cool way to learn
  • 00:09:30 ➜ video puzzles I don't think I've done
  • 00:09:31 ➜ that one so it's like you're
  • 00:09:34 ➜ what do you do in there
  • 00:09:36 ➜ basically you have like op codes and
  • 00:09:40 ➜ then you have like you have like a jumpy
  • 00:09:42 ➜ op code and you need that jumpy op code
  • 00:09:45 ➜ to jump to the to the jump destination
  • 00:09:48 ➜ to to the jump destination so that the
  • 00:09:51 ➜ function doesn't revert uh send you the
  • 00:09:54 ➜ link here
  • 00:09:56 ➜ interesting
  • 00:09:59 ➜ Lisa have you heard of this
  • 00:10:01 ➜ yes it's a CTF uh kind of a Puzo CTF you
  • 00:10:04 ➜ do to learn the evm the internals this
  • 00:10:07 ➜ is really interesting really good one
  • 00:10:09 ➜ yep thank you I think I mean I think
  • 00:10:12 ➜ this is really what you guys are seeing
  • 00:10:14 ➜ I mean coming down to learning the evm
  • 00:10:18 ➜ is one of the most important aspects and
  • 00:10:21 ➜ the evm seems so complicated until you
  • 00:10:24 ➜ get simple you know like I don't know
  • 00:10:26 ➜ how you guys feel about this but
  • 00:10:28 ➜ it's really hard for me to to interpret
  • 00:10:32 ➜ the the program counter so when I'm
  • 00:10:34 ➜ looking at the assemble uh the assembly
  • 00:10:37 ➜ instructions is really hard for me you
  • 00:10:39 ➜ know you also it's really hard for me to
  • 00:10:42 ➜ to grasp my head into that there's any
  • 00:10:44 ➜ kind of treats or I think just
  • 00:10:46 ➜ practicing right
  • 00:10:50 ➜ so for me uh one thing that really
  • 00:10:52 ➜ helped was uh as anona said here
  • 00:10:54 ➜ building your evm from scratch and uh in
  • 00:10:58 ➜ the I think Alchemy University was the
  • 00:11:01 ➜ one I don't know I do quite a few of
  • 00:11:02 ➜ those but I believe in alchemy
  • 00:11:04 ➜ University they go through even not
  • 00:11:07 ➜ really building your own evm uh fully
  • 00:11:10 ➜ but
  • 00:11:11 ➜ for the most part you'll understand Json
  • 00:11:13 ➜ RPC requests and
  • 00:11:15 ➜ um you know like actually like making
  • 00:11:17 ➜ these these these objects of the block
  • 00:11:20 ➜ information the transaction and so forth
  • 00:11:22 ➜ and then after that at least for me it
  • 00:11:25 ➜ became a lot more clear so I would
  • 00:11:27 ➜ recommend I believe it's the Alchemy
  • 00:11:28 ➜ University for that really nice
  • 00:11:33 ➜ yeah so definitely check out those evm
  • 00:11:35 ➜ puzzles it's a really cool way to learn
  • 00:11:38 ➜ and if you don't know if you have
  • 00:11:41 ➜ problems with the program counter then
  • 00:11:43 ➜ you can just check out the playground of
  • 00:11:45 ➜ vpm codes or just the remix debugger or
  • 00:11:49 ➜ The Foundry deeper so the Second Step I
  • 00:11:52 ➜ would say learn some tips and tricks
  • 00:11:54 ➜ right oh there are many tips and tricks
  • 00:11:56 ➜ that are definitely good to know like
  • 00:11:57 ➜ for example caching the array length and
  • 00:12:00 ➜ sort of this stuff you know you will
  • 00:12:03 ➜ never learn every single tip but just
  • 00:12:05 ➜ try to try to see how the best struggle
  • 00:12:09 ➜ to do it and do it the same way
  • 00:12:14 ➜ nice but it really helped me was oh
  • 00:12:16 ➜ sorry go ahead this
  • 00:12:19 ➜ no no this is a really nice I mean and
  • 00:12:22 ➜ and can I ask you guys something uh so
  • 00:12:24 ➜ ours was saying that his wake up call
  • 00:12:27 ➜ for gas was CRC 721 Nave right ours yes
  • 00:12:34 ➜ c1721a yeah uh so what was the big
  • 00:12:37 ➜ difference in there and how much of a
  • 00:12:40 ➜ gas saving we had from this contract to
  • 00:12:42 ➜ a classic nft
  • 00:12:45 ➜ or basically the the the open Zeppelin
  • 00:12:49 ➜ one just loops and mints uh each token
  • 00:12:54 ➜ and basically the erc71 uh batch mins
  • 00:12:58 ➜ them and stores all the
  • 00:13:01 ➜ or that all the tokens for the one owner
  • 00:13:05 ➜ and yeah the gas cards were really big
  • 00:13:09 ➜ foreign
  • 00:13:12 ➜ sorry to cut you off there I was just
  • 00:13:14 ➜ saying it's interesting because that was
  • 00:13:15 ➜ one of the uh looking into erc721 versus
  • 00:13:18 ➜ 721a it was one of the first times where
  • 00:13:21 ➜ I was seeing like the complexity and the
  • 00:13:24 ➜ gas specifically in the you know it
  • 00:13:26 ➜ depends on which project you're using
  • 00:13:28 ➜ right which one you want to use 721 or
  • 00:13:30 ➜ 7218 if you have a project like azuki or
  • 00:13:33 ➜ you know board date where you
  • 00:13:34 ➜ potentially will have a lot of people
  • 00:13:36 ➜ you know minting like or saying batch
  • 00:13:37 ➜ minting and obviously you want to do
  • 00:13:39 ➜ 721a but if I remember correctly the 721
  • 00:13:42 ➜ was more gas efficient for single vents
  • 00:13:45 ➜ and so you know you have to take all
  • 00:13:47 ➜ this into consideration with these
  • 00:13:49 ➜ products yeah and also the I think the
  • 00:13:51 ➜ transfers uh when you transfer it to
  • 00:13:53 ➜ Target was also uh cheaper for the open
  • 00:13:56 ➜ Zeppelin one
  • 00:13:57 ➜ but yeah
  • 00:14:00 ➜ yeah oh and and then the third step I
  • 00:14:04 ➜ would say learn you that's how you like
  • 00:14:08 ➜ access the evm's financial and yeah
  • 00:14:11 ➜ that's how you really eliminate gas and
  • 00:14:13 ➜ unnecessary up codes
  • 00:14:16 ➜ really cool I'm inviting more people to
  • 00:14:18 ➜ speak so if they have questions they can
  • 00:14:21 ➜ just open their mics
  • 00:14:23 ➜ and and and and guys today there's a lot
  • 00:14:27 ➜ of talks regarding SO gas is really
  • 00:14:30 ➜ important right everybody is looking at
  • 00:14:31 ➜ it it is getting more and more complex
  • 00:14:33 ➜ and there's that awful question about
  • 00:14:36 ➜ you know gas versus security
  • 00:14:39 ➜ we'll talk about this yeah so go on
  • 00:14:43 ➜ just probably on the end or like
  • 00:14:49 ➜ oh so we uh we wanted to talk about also
  • 00:14:53 ➜ the fourth step I would say just never
  • 00:14:56 ➜ stop learning and just think you know a
  • 00:14:59 ➜ lot of optimizations come from thinking
  • 00:15:01 ➜ oh just think about the architecture and
  • 00:15:03 ➜ stuff like that and just never stop
  • 00:15:05 ➜ learning I don't know every single gas
  • 00:15:08 ➜ optimization that exists on the contest
  • 00:15:10 ➜ that I was auditing I found some autism
  • 00:15:14 ➜ optimizations that I never thought about
  • 00:15:16 ➜ so just the only way to found that find
  • 00:15:19 ➜ out is to Benchmark and test
  • 00:15:24 ➜ um I would also mention uh the game has
  • 00:15:27 ➜ kind of changed a little bit with the
  • 00:15:28 ➜ Bots you know the automated guest
  • 00:15:31 ➜ finding and so forth I think they're
  • 00:15:33 ➜ they're great personally but that's not
  • 00:15:34 ➜ the point of what I'm about to say in
  • 00:15:37 ➜ that a lot of these things like you know
  • 00:15:39 ➜ caching your array length um do well
  • 00:15:42 ➜ versus for you know transfer from not
  • 00:15:45 ➜ being checked
  • 00:15:46 ➜ Etc all these things are going to be
  • 00:15:47 ➜ found by these automated Bots and that's
  • 00:15:49 ➜ fine so if you're if you're in it for
  • 00:15:53 ➜ your own little private audit thing then
  • 00:15:55 ➜ obviously you need to know you need to
  • 00:15:57 ➜ know it all but if you know you just
  • 00:15:59 ➜ you're trying to get the Bare Bones and
  • 00:16:00 ➜ you want to actually make some money and
  • 00:16:02 ➜ make it fun to begin with I would focus
  • 00:16:04 ➜ with uh things that that bot's not going
  • 00:16:07 ➜ to find and that's honestly going to be
  • 00:16:09 ➜ a lot more creative you know it's not
  • 00:16:11 ➜ going to be scanning for something that
  • 00:16:13 ➜ some regex or some asked can find
  • 00:16:15 ➜ so you're going to really be looking for
  • 00:16:19 ➜ um is there a way for us to delete a
  • 00:16:21 ➜ line somewhere right are they uh writing
  • 00:16:23 ➜ to storage three different times and
  • 00:16:25 ➜ it's all the same thing uh you're
  • 00:16:27 ➜ looking for uh redundancies in the code
  • 00:16:30 ➜ you're looking for potential bit shifts
  • 00:16:31 ➜ that that were caught by the bot and so
  • 00:16:34 ➜ forth and it's a lot more fun I think
  • 00:16:35 ➜ but I just wanted to throw it out there
  • 00:16:38 ➜ 100 you know let's talk about I'll sort
  • 00:16:43 ➜ of just share my auditing process but
  • 00:16:45 ➜ you know if you can if you can just find
  • 00:16:48 ➜ a gas optimization without understanding
  • 00:16:51 ➜ what the code does it it will probably
  • 00:16:54 ➜ be found by the bot too so you really
  • 00:16:57 ➜ have to understand like what is being
  • 00:16:59 ➜ done there and just I remember when you
  • 00:17:02 ➜ posted like a a gas golfing Challenge
  • 00:17:05 ➜ and was like a for Loop and the for Loop
  • 00:17:08 ➜ basically performs some math right and
  • 00:17:12 ➜ uh basically people like me thought okay
  • 00:17:15 ➜ I'm gonna optimize this Loop but the
  • 00:17:17 ➜ solution was to rewind right the whole
  • 00:17:20 ➜ block and just remove the loop so that's
  • 00:17:23 ➜ exactly exactly what you should be doing
  • 00:17:25 ➜ not just focusing on this small
  • 00:17:27 ➜ optimizations but actually rewriting
  • 00:17:29 ➜ right
  • 00:17:34 ➜ indeed yes so now let's let's talk about
  • 00:17:38 ➜ how to write a gas optimized contract
  • 00:17:42 ➜ I think you should start with uh
  • 00:17:45 ➜ with an efficient architecture so you
  • 00:17:49 ➜ have to spend a lot of time thinking of
  • 00:17:51 ➜ an efficient architecture like uh for
  • 00:17:55 ➜ example the blend from blur that was
  • 00:17:57 ➜ written by the goat Transmissions
  • 00:18:00 ➜ and basically the blend contract
  • 00:18:02 ➜ minimizes how much data is stored on
  • 00:18:04 ➜ chain uh significantly reducing the
  • 00:18:07 ➜ number of expensive as stores and sloads
  • 00:18:10 ➜ for example The Loan Data is not stored
  • 00:18:14 ➜ on chain instead the contract simply
  • 00:18:16 ➜ stores a mapping of loan ID to Lone hash
  • 00:18:20 ➜ and yep just remove what's unnecessary
  • 00:18:23 ➜ and use release code
  • 00:18:25 ➜ and those the second thing I would say
  • 00:18:28 ➜ do more what is cheap and less what is
  • 00:18:30 ➜ expensive so if you can rewrite or
  • 00:18:33 ➜ organize your code so you're doing more
  • 00:18:35 ➜ what is cheap and less what is expensive
  • 00:18:36 ➜ then you're saving gas and there's sort
  • 00:18:39 ➜ of two levels of optimizations here of
  • 00:18:43 ➜ the salinity stuff like using memory and
  • 00:18:45 ➜ starch in the correct way and the
  • 00:18:48 ➜ assembly stuff like really eliminating
  • 00:18:50 ➜ an sgr codes and
  • 00:18:52 ➜ uh rewriting big Loops you know to
  • 00:18:55 ➜ assembly and you know every optimization
  • 00:18:57 ➜ here will just have a reason why it's
  • 00:18:59 ➜ cheaper here
  • 00:19:01 ➜ and the third thing just search for
  • 00:19:05 ➜ those tips and tricks oh this can
  • 00:19:08 ➜ obviously be automated by some Bots and
  • 00:19:12 ➜ just for example pre-incrementing which
  • 00:19:14 ➜ by the way doesn't work if you compile
  • 00:19:16 ➜ it with the
  • 00:19:18 ➜ viir so the compiler is sometimes a bit
  • 00:19:21 ➜ lazy but again it's not your excuse not
  • 00:19:24 ➜ to optimize and number four I would say
  • 00:19:27 ➜ just always test try Benchmark sql's
  • 00:19:31 ➜ better and rewrite
  • 00:19:34 ➜ yeah
  • 00:19:36 ➜ what do you think oh is this a good way
  • 00:19:40 ➜ to write a gas optimized contract
  • 00:19:43 ➜ I think that's a great way personally
  • 00:19:47 ➜ um I would I would always say to
  • 00:19:50 ➜ so if you're okay so I don't really know
  • 00:19:52 ➜ I'm guessing this audience more Auditors
  • 00:19:54 ➜ but I'm going to speak from like a
  • 00:19:56 ➜ developer's standpoint if you're
  • 00:19:58 ➜ developing a a contract and you want to
  • 00:20:00 ➜ do you know your gaps optimization and
  • 00:20:02 ➜ and you know some things but you don't
  • 00:20:04 ➜ know a lot that's that's fine I would
  • 00:20:06 ➜ just rewrite that function in about as
  • 00:20:08 ➜ many different ways possible you know
  • 00:20:10 ➜ that's what I did at least when I was
  • 00:20:11 ➜ learning but does it do well do what
  • 00:20:13 ➜ does a four do if I do it you know this
  • 00:20:15 ➜ that what if I start pre-increment and
  • 00:20:17 ➜ so forth and if you just do that with
  • 00:20:20 ➜ your contract that you're developing
  • 00:20:21 ➜ you're eventually going to find at least
  • 00:20:23 ➜ a more efficient way than what you had
  • 00:20:25 ➜ in the beginning
  • 00:20:26 ➜ uh say I just want to throw that out
  • 00:20:28 ➜ there
  • 00:20:30 ➜ yeah definitely so
  • 00:20:32 ➜ oh let's maybe talk about tattoo
  • 00:20:34 ➜ actually audit a contract we talked
  • 00:20:36 ➜ about how to write a contract now we'll
  • 00:20:38 ➜ talk about how to audit and the contract
  • 00:20:41 ➜ and find some gas optimizations so you
  • 00:20:43 ➜ want to share some stuff
  • 00:20:46 ➜ about this sure so
  • 00:20:48 ➜ I mean the auditing process is obviously
  • 00:20:50 ➜ going to be different from person to
  • 00:20:51 ➜ person
  • 00:20:52 ➜ but I I mean I've studied actually quite
  • 00:20:55 ➜ a few you know Patrick Collins uh bytes
  • 00:20:58 ➜ 32 I think even trust a few of them I've
  • 00:21:01 ➜ looked at their Twitters I've you know
  • 00:21:03 ➜ read their reports and no matter what
  • 00:21:07 ➜ there's always one key thing that every
  • 00:21:10 ➜ auditor is going to do at least at some
  • 00:21:11 ➜ point and that is understanding the
  • 00:21:13 ➜ protocol right so you gotta go into code
  • 00:21:15 ➜ Arena you got to read whatever's on that
  • 00:21:18 ➜ that GitHub you have to read all the
  • 00:21:20 ➜ docs that are in there you have to go to
  • 00:21:22 ➜ the code Arena Discord you have to open
  • 00:21:25 ➜ up that that one for that specific
  • 00:21:27 ➜ contest people will be asking great
  • 00:21:29 ➜ questions and these questions are coming
  • 00:21:31 ➜ from you know some somewhere in their
  • 00:21:33 ➜ mind so keep that in mind and
  • 00:21:36 ➜ um yeah you're just gonna have to
  • 00:21:37 ➜ understand that protocol at some point
  • 00:21:39 ➜ so that's the point I will make yeah
  • 00:21:41 ➜ definitely that's always the first point
  • 00:21:43 ➜ even if like you're doing a Goss gas
  • 00:21:46 ➜ audit and not a security just understand
  • 00:21:49 ➜ the paragraph As I said if you find the
  • 00:21:51 ➜ optimization without understanding the
  • 00:21:54 ➜ particle then it was probably already
  • 00:21:56 ➜ found by a bot so you won't really earn
  • 00:22:00 ➜ much from it and just then you can uh
  • 00:22:04 ➜ and you just find you see what what is
  • 00:22:06 ➜ expensive what is cheap and just rewrite
  • 00:22:09 ➜ you know
  • 00:22:11 ➜ and you know optimizing is good but like
  • 00:22:13 ➜ you also have to rewrite and that's how
  • 00:22:17 ➜ you also optimize and then just
  • 00:22:22 ➜ change Benchmark rate just see what's
  • 00:22:24 ➜ better I use The Foundry uh gas report
  • 00:22:27 ➜ you can also use the harder one and yeah
  • 00:22:30 ➜ and number four just write the report I
  • 00:22:33 ➜ this is very important because code
  • 00:22:35 ➜ Arena only selects the best reports and
  • 00:22:39 ➜ just really spend some
  • 00:22:41 ➜ a decent amount of time just writing the
  • 00:22:44 ➜ protocol
  • 00:22:45 ➜ uh you should have like a good
  • 00:22:48 ➜ explanation why you think it's it's
  • 00:22:50 ➜ cheaper and a good recommendation and uh
  • 00:22:54 ➜ all the instances and just how much gas
  • 00:22:57 ➜ was saved and just you're not you won't
  • 00:22:59 ➜ earn much if you just submit like a few
  • 00:23:03 ➜ of gas a few gas optimizations you have
  • 00:23:06 ➜ to have a good quantity of
  • 00:23:09 ➜ gas optimizations and a good quality
  • 00:23:12 ➜ report
  • 00:23:13 ➜ so yeah that's that's my auditing
  • 00:23:16 ➜ process
  • 00:23:18 ➜ yeah definitely if I'm focusing on the
  • 00:23:19 ➜ the gas uh I think I've already you know
  • 00:23:22 ➜ told you guys basically looking at
  • 00:23:23 ➜ what's
  • 00:23:24 ➜ what's being you know instantiated twice
  • 00:23:27 ➜ are we doing things that we can be bit
  • 00:23:29 ➜ shifting uh these these kinds of things
  • 00:23:32 ➜ but your biggest yes optimization is
  • 00:23:34 ➜ going to be something that you rework
  • 00:23:36 ➜ right so something where
  • 00:23:38 ➜ um
  • 00:23:39 ➜ where you know like the for Loop or
  • 00:23:41 ➜ something something in general can be
  • 00:23:44 ➜ massively changed and so that's what I'm
  • 00:23:47 ➜ usually looking for and of course you
  • 00:23:48 ➜ can't change the the functionality and
  • 00:23:50 ➜ you can't introduce bugs so you can't
  • 00:23:52 ➜ change a whole lot you know you got to
  • 00:23:54 ➜ make you got to make sure you're really
  • 00:23:55 ➜ careful with that
  • 00:23:57 ➜ um but yeah so for the auditing process
  • 00:23:59 ➜ though I definitely I look through I
  • 00:24:00 ➜ make sure I understand the protocol I go
  • 00:24:03 ➜ through each each
  • 00:24:04 ➜ script very briefly very fast running
  • 00:24:08 ➜ through it and then lastly I will go
  • 00:24:11 ➜ through and line by line
  • 00:24:13 ➜ do exactly what ours is talking about
  • 00:24:15 ➜ you know rework it figure it out see if
  • 00:24:18 ➜ there's anything I can optimize
  • 00:24:22 ➜ yeah 100 so
  • 00:24:25 ➜ let's right talk about about the current
  • 00:24:28 ➜ state of gas organization and what does
  • 00:24:30 ➜ the future hold for this field uh right
  • 00:24:33 ➜ now it's a quite New Field and a very
  • 00:24:36 ➜ interesting one too uh
  • 00:24:39 ➜ audits are kind of new right but
  • 00:24:42 ➜ it's great that some programs care about
  • 00:24:44 ➜ the users and not even about their users
  • 00:24:47 ➜ but the users of the whole network
  • 00:24:50 ➜ and why don't protocols optimize is it
  • 00:24:53 ➜ because of readability is it because of
  • 00:24:55 ➜ security what do you think
  • 00:24:58 ➜ I think readability has a lot to do with
  • 00:25:00 ➜ it I've seen I've seen projects just
  • 00:25:02 ➜ straight up reject you know doing these
  • 00:25:04 ➜ gas optimizations because of readability
  • 00:25:05 ➜ issues
  • 00:25:06 ➜ and it was something I even struggled
  • 00:25:09 ➜ with you know a little bit myself but I
  • 00:25:12 ➜ think that Beyond readability it's more
  • 00:25:15 ➜ so right now that it's just not it's not
  • 00:25:18 ➜ paid out right you go to code Arena you
  • 00:25:19 ➜ go to Sherlock and you get like yeah
  • 00:25:21 ➜ like this this hundred thousand dollar
  • 00:25:23 ➜ price pool and one thousands of its gaps
  • 00:25:25 ➜ you know and you got 50 different people
  • 00:25:27 ➜ competing for that so a lot of people
  • 00:25:30 ➜ probably just skip over it a lot of
  • 00:25:31 ➜ people will see those numbers and I
  • 00:25:34 ➜ think it's not important
  • 00:25:35 ➜ um
  • 00:25:37 ➜ there are a lot of private auditing
  • 00:25:39 ➜ people coming out I know uh Harrison was
  • 00:25:42 ➜ doing something good there of course
  • 00:25:43 ➜ you'd have uh
  • 00:25:45 ➜ bars here and myself focusing on this so
  • 00:25:49 ➜ there are people that care about it but
  • 00:25:50 ➜ that's what I would say
  • 00:25:52 ➜ yeah definitely but you know most gas
  • 00:25:55 ➜ optimization don't even have to come
  • 00:25:57 ➜ from you also
  • 00:25:58 ➜ so you know I think that like when you
  • 00:26:01 ➜ rewrite to you then okay that's kind of
  • 00:26:04 ➜ understandable that there's a security
  • 00:26:05 ➜ risk but some gas optimization don't
  • 00:26:09 ➜ even have to come from you and sometimes
  • 00:26:12 ➜ the devs are just lazy to optimize and
  • 00:26:15 ➜ it can sometimes
  • 00:26:17 ➜ uh improve the readability but sometimes
  • 00:26:22 ➜ they can agree with that but like
  • 00:26:25 ➜ it shouldn't be an excuse for devs not
  • 00:26:27 ➜ to optimize right
  • 00:26:30 ➜ and we have seen some parallels being
  • 00:26:32 ➜ optimized and some protocols like Ian or
  • 00:26:35 ➜ curve or even Rewritten to Viper
  • 00:26:39 ➜ what do you think will we see more
  • 00:26:41 ➜ particles being optimized
  • 00:26:43 ➜ I think so I think in the future it's
  • 00:26:46 ➜ inevitable as as we get closer and
  • 00:26:49 ➜ closer towards you know actual adoption
  • 00:26:51 ➜ of this mainstream adoption then we're
  • 00:26:54 ➜ going to have the kind of uh
  • 00:26:56 ➜ coalescence of some sense where a lot of
  • 00:26:59 ➜ these Protocols are essentially going at
  • 00:27:00 ➜ least I think this is what I'm thinking
  • 00:27:01 ➜ all these Protocols are going to kind of
  • 00:27:03 ➜ be you know converging and so forth and
  • 00:27:05 ➜ a lot of them are going to hit the right
  • 00:27:06 ➜ side just like any startup Market any
  • 00:27:09 ➜ kind of Emerging Market oh all these you
  • 00:27:12 ➜ know excess ones will hit the hit the
  • 00:27:14 ➜ Wayside and these ones that are left
  • 00:27:16 ➜ standing will need to optimize or else
  • 00:27:18 ➜ they're going to be pushed aside that's
  • 00:27:19 ➜ what I'm thinking yes I think that the
  • 00:27:22 ➜ same though many particles that exist
  • 00:27:24 ➜ today can be significantly optimized
  • 00:27:27 ➜ and but the question is when ethereum
  • 00:27:30 ➜ scales will the devs have to worry about
  • 00:27:32 ➜ optimizing their code oh no
  • 00:27:36 ➜ that's a good question it's a good
  • 00:27:38 ➜ question
  • 00:27:39 ➜ not entirely sure
  • 00:27:41 ➜ but we do uh we do have a question here
  • 00:27:42 ➜ from Ronan in the chat ours if you want
  • 00:27:44 ➜ to if you want to hit this one he's
  • 00:27:46 ➜ asking would like to know uh what are
  • 00:27:48 ➜ some of the ways in process for someone
  • 00:27:50 ➜ to do these guests optimization reports
  • 00:27:52 ➜ and these qualitative analysis reports
  • 00:27:54 ➜ for a contest for a newbie
  • 00:27:58 ➜ yeah okay so just uh I know that code
  • 00:28:01 ➜ Arena and also Health Finance to these
  • 00:28:05 ➜ cars
  • 00:28:06 ➜ that you can submit and just basically
  • 00:28:10 ➜ uh the juice box which is and I just
  • 00:28:14 ➜ submitted the the gas report and you
  • 00:28:17 ➜ know I earned a quite nice reward right
  • 00:28:20 ➜ and just as I said uh
  • 00:28:27 ➜ you know we've mentioned how we should
  • 00:28:30 ➜ learn and
  • 00:28:31 ➜ if you want to like as I said first
  • 00:28:34 ➜ understand the particle as you would do
  • 00:28:38 ➜ with when doing security and just
  • 00:28:41 ➜ oh the Bots are getting quite good so
  • 00:28:44 ➜ you're not gonna find these small tips
  • 00:28:46 ➜ and tricks so just find some uh code
  • 00:28:51 ➜ that isn't used find code that can be uh
  • 00:28:56 ➜ can be Rewritten into a cheaper way you
  • 00:28:59 ➜ know we have to understand what is cheap
  • 00:29:01 ➜ and what is expensive and then do what
  • 00:29:04 ➜ is cheap and just
  • 00:29:06 ➜ as we as we mentioned you have to
  • 00:29:09 ➜ rewrite not optimize and just Benchmark
  • 00:29:12 ➜ use Foundry
  • 00:29:14 ➜ test see what's better and you know I I
  • 00:29:17 ➜ said that I didn't even know about the
  • 00:29:20 ➜ gas optimizations that I found so you
  • 00:29:23 ➜ just have to go line by line and just
  • 00:29:25 ➜ see what what can be done here
  • 00:29:30 ➜ yeah and some tips like General about
  • 00:29:32 ➜ like the process of auditing I've gone
  • 00:29:34 ➜ through a different set of you know ways
  • 00:29:36 ➜ of auditing these these protocols and
  • 00:29:38 ➜ one thing that's really helping me right
  • 00:29:39 ➜ now is markdown so if you don't know
  • 00:29:42 ➜ markdown definitely with learning that
  • 00:29:44 ➜ and uh it's just been really easy for me
  • 00:29:47 ➜ to take notes to like keep everything a
  • 00:29:50 ➜ little bit more organized while doing
  • 00:29:52 ➜ all this especially when you're doing
  • 00:29:54 ➜ gas optimization you have all these gas
  • 00:29:55 ➜ reports and everything it can get a
  • 00:29:57 ➜ little out of hand and having a nice
  • 00:30:00 ➜ organized pre-report can really do a lot
  • 00:30:03 ➜ of good in fact I just read a tweet from
  • 00:30:05 ➜ from somebody quite prominent in the
  • 00:30:08 ➜ space I'm drawing blank right now about
  • 00:30:10 ➜ how they made some comment you know with
  • 00:30:12 ➜ uh you know two little words there and
  • 00:30:14 ➜ they're sitting there for two hours
  • 00:30:15 ➜ trying to figure out what they saw and
  • 00:30:18 ➜ you want to make sure you avoid that and
  • 00:30:20 ➜ do a proper job with your pre-report
  • 00:30:23 ➜ yeah I think like like the report for
  • 00:30:26 ➜ gas really matters as I said but Arena
  • 00:30:28 ➜ only selects the best reports so that
  • 00:30:31 ➜ really matters you can just submit a few
  • 00:30:33 ➜ gas optimizations you have to solubate a
  • 00:30:35 ➜ lot of gas optimizations and actually
  • 00:30:37 ➜ show that cure you're saving gas and
  • 00:30:40 ➜ provide a reason uh why it is like that
  • 00:30:43 ➜ I can also send you like my template for
  • 00:30:46 ➜ the report later
  • 00:30:48 ➜ just for someone to learn and yeah
  • 00:30:53 ➜ so about the about the ethereum when it
  • 00:30:57 ➜ scales I think that I think that deaths
  • 00:31:00 ➜ will still have to uh optimize their
  • 00:31:03 ➜ code and uh the reason is simple and
  • 00:31:06 ➜ that is because of the transaction
  • 00:31:08 ➜ computation power and so the more gas
  • 00:31:12 ➜ your function costs the less you can do
  • 00:31:14 ➜ in a single transaction right and just
  • 00:31:18 ➜ every time I tweet the gas optimization
  • 00:31:21 ➜ people are like why the [Β __Β ] would you
  • 00:31:24 ➜ do this if you can just use a layer 2
  • 00:31:26 ➜ Chain and I'll say that because of the
  • 00:31:30 ➜ transaction computation power so that's
  • 00:31:32 ➜ that's what I think
  • 00:31:36 ➜ most definitely I thought you were more
  • 00:31:37 ➜ referring to you know like the you know
  • 00:31:39 ➜ how all this uh for example right now
  • 00:31:41 ➜ the optimizers and so forth are kind of
  • 00:31:45 ➜ we're slowly but surely as these
  • 00:31:46 ➜ solidity versions get higher and higher
  • 00:31:48 ➜ edging towards the area where it's doing
  • 00:31:52 ➜ a lot of the work right and a lot of
  • 00:31:53 ➜ this gas optimization that gets done a
  • 00:31:55 ➜ lot of people will even argue is you
  • 00:31:57 ➜ know solidities
  • 00:31:58 ➜ mistakes right the dubs are kind of
  • 00:32:01 ➜ making up for the mistakes of the
  • 00:32:03 ➜ development of ethereum that's what
  • 00:32:04 ➜ they're yeah their argument is
  • 00:32:07 ➜ um and so yeah I thought you were going
  • 00:32:08 ➜ on you know what if there's no more
  • 00:32:10 ➜ mistakes what if you can just have a DOT
  • 00:32:14 ➜ length in the at the cat in the no
  • 00:32:15 ➜ caching of the length of the array and
  • 00:32:17 ➜ it just figures it out for you
  • 00:32:20 ➜ yeah definitely I'm also excited to see
  • 00:32:23 ➜ new upcoats that uh that will be added
  • 00:32:26 ➜ and like we've seen with push zero or
  • 00:32:29 ➜ when we might finally have transient
  • 00:32:32 ➜ storage
  • 00:32:35 ➜ right so I think we can discuss some
  • 00:32:38 ➜ idea
  • 00:32:45 ➜ years come to gas station I have a lot
  • 00:32:47 ➜ of ideas for projects that can be
  • 00:32:52 ➜ built that can help developers optimize
  • 00:32:55 ➜ their code so for example everyone
  • 00:32:57 ➜ everyone's focusing on security right
  • 00:32:59 ➜ now but gas optimizations are kind of
  • 00:33:01 ➜ overlooked and for example we have
  • 00:33:04 ➜ slither right for security but I didn't
  • 00:33:07 ➜ see anything like that for gas
  • 00:33:08 ➜ optimizations like uh two like everyone
  • 00:33:10 ➜ can use there are obviously these bus on
  • 00:33:13 ➜ code Arena but there is like a tool that
  • 00:33:15 ➜ everyone can use what do you think would
  • 00:33:18 ➜ that work
  • 00:33:20 ➜ that's difficult because uh
  • 00:33:23 ➜ well I mean that's a really good
  • 00:33:26 ➜ question I would say something along the
  • 00:33:28 ➜ lines of there might be like incremental
  • 00:33:30 ➜ Innovations on these like gas reports
  • 00:33:33 ➜ like Foundry and hard hat
  • 00:33:35 ➜ but it's really hard to to make a tool
  • 00:33:38 ➜ that doesn't fix it for you you know
  • 00:33:39 ➜ what I'm saying it's already going to
  • 00:33:41 ➜ recognize that there's an issue
  • 00:33:42 ➜ somewhere and unless this tool does some
  • 00:33:46 ➜ kind of
  • 00:33:47 ➜ the rework like this reworking for you
  • 00:33:49 ➜ you know those lines around and so forth
  • 00:33:51 ➜ like almost like a fuzzing type thing
  • 00:33:53 ➜ maybe
  • 00:33:55 ➜ maybe but I I would just say it's
  • 00:33:57 ➜ probably going to be very difficult yeah
  • 00:34:00 ➜ I mean it can be done for like these
  • 00:34:03 ➜ small tips and tricks and I would love
  • 00:34:06 ➜ to see it too like that just for the
  • 00:34:08 ➜ small tips right but so it's not gonna
  • 00:34:11 ➜ optimize like
  • 00:34:13 ➜ a lot of a bunch of code right like a
  • 00:34:16 ➜ person would do and that understands how
  • 00:34:18 ➜ the event works
  • 00:34:19 ➜ and we also have immunify bright but
  • 00:34:23 ➜ like what a bug Bounty or a gas Bounty
  • 00:34:26 ➜ platform work
  • 00:34:30 ➜ that's done this definitely sounds like
  • 00:34:32 ➜ a good idea I think personally I'm
  • 00:34:34 ➜ surprised they don't have it already and
  • 00:34:36 ➜ I'm really surprised Honestly by the
  • 00:34:38 ➜ lack I love that gaskets in the code
  • 00:34:40 ➜ arena in short contest as it is but yeah
  • 00:34:42 ➜ the gas bounty
  • 00:34:44 ➜ and I think the biggest problem as I'm
  • 00:34:46 ➜ as I'm saying this the biggest problem
  • 00:34:48 ➜ is that it's going to cost these
  • 00:34:50 ➜ protocols money and
  • 00:34:51 ➜ they're not going to get anything right
  • 00:34:54 ➜ off the bat from it you know security
  • 00:34:56 ➜ it's pretty obvious why they need to
  • 00:34:58 ➜ secure this and even just having an
  • 00:35:00 ➜ audit from code Arena will entice the
  • 00:35:03 ➜ investors things like this
  • 00:35:05 ➜ so you really have to find a way to
  • 00:35:08 ➜ motivate the protocols to do it is where
  • 00:35:10 ➜ I'm getting it and I don't really know
  • 00:35:13 ➜ where where we're at with that
  • 00:35:16 ➜ yeah definitely uh you don't oh you
  • 00:35:19 ➜ don't like help only the users of your
  • 00:35:21 ➜ particle you help the users of
  • 00:35:24 ➜ the whole network right and I think it
  • 00:35:28 ➜ would be cool if you had like a gas
  • 00:35:30 ➜ monkey platform but there should be some
  • 00:35:33 ➜ ways so people don't submit like just
  • 00:35:37 ➜ these small tips and stuff like that and
  • 00:35:39 ➜ I submit actual like results
  • 00:35:46 ➜ so I think we can answer questions yeah
  • 00:35:50 ➜ Awesome Brothers I mean that's great
  • 00:35:52 ➜ explanation really love what you guys
  • 00:35:54 ➜ are doing here okay one question that I
  • 00:35:56 ➜ have for you is today there's a little
  • 00:35:58 ➜ bit of a fear of using things like Huff
  • 00:36:01 ➜ own production with deployed contracts
  • 00:36:04 ➜ you guys see a future where we're gonna
  • 00:36:07 ➜ start doing that more
  • 00:36:13 ➜ um so with Huff
  • 00:36:14 ➜ the first thing I'll say is
  • 00:36:17 ➜ I'm not really too good with like that
  • 00:36:20 ➜ yet I'm still in the learning process of
  • 00:36:22 ➜ all that so I need to take this with a
  • 00:36:24 ➜ huge grain of salt and now by all means
  • 00:36:26 ➜ an expert at this but if I remember
  • 00:36:28 ➜ correctly you can't verify a contract
  • 00:36:30 ➜ that's been written in Huff right so
  • 00:36:32 ➜ that's one thing to
  • 00:36:34 ➜ definitely think about
  • 00:36:36 ➜ um yeah or does he have anything to say
  • 00:36:38 ➜ oh yeah I'm also not an expert in her
  • 00:36:41 ➜ for a Viper but you know I think Viper
  • 00:36:45 ➜ has some like good security stuff that
  • 00:36:47 ➜ Solarity doesn't have
  • 00:36:49 ➜ and yeah
  • 00:36:51 ➜ I don't know I think in the future we
  • 00:36:53 ➜ will see some protocols being Rewritten
  • 00:36:56 ➜ to Viper hoof but as we've seen with the
  • 00:36:59 ➜ uni swap E4
  • 00:37:01 ➜ Maybe
  • 00:37:04 ➜ I'll see you see a potential
  • 00:37:07 ➜ I'm sorry I just want to say do you see
  • 00:37:10 ➜ a potential issue there with Puffin
  • 00:37:12 ➜ Viper and I mean obviously I mean even
  • 00:37:14 ➜ in in this group here of people who
  • 00:37:16 ➜ those solidity quite well probably if
  • 00:37:18 ➜ it's not not our strongest I see over
  • 00:37:21 ➜ here Huff is awesome in the comments so
  • 00:37:22 ➜ maybe maybe alms over here but uh
  • 00:37:25 ➜ nonetheless you know my point being
  • 00:37:26 ➜ solidity is a little bit easier to to
  • 00:37:29 ➜ code in a little bit easier to audit and
  • 00:37:31 ➜ do you think it would have a bad impact
  • 00:37:33 ➜ in terms of security measures okay
  • 00:37:35 ➜ you're going into huffing and Viper for
  • 00:37:38 ➜ grass optimizations and then you get
  • 00:37:39 ➜ less
  • 00:37:40 ➜ less Auditors actually looking at your
  • 00:37:43 ➜ code
  • 00:37:44 ➜ I mean yeah definitely like I think that
  • 00:37:47 ➜ security will always be the number one
  • 00:37:50 ➜ thing that others will focus on but
  • 00:37:54 ➜ some some travels I think that some
  • 00:37:57 ➜ Goods that have
  • 00:37:58 ➜ good deaf teams I think that can will be
  • 00:38:02 ➜ Rewritten to Viper hoof
  • 00:38:07 ➜ hello good afternoon
  • 00:38:10 ➜ good afternoon
  • 00:38:12 ➜ and good day
  • 00:38:15 ➜ um I have two questions but like I want
  • 00:38:17 ➜ to first start from like thanking you
  • 00:38:20 ➜ Arc because when I started up I used to
  • 00:38:22 ➜ like look at your tweets I'll get
  • 00:38:24 ➜ compared to like because I had a hard
  • 00:38:26 ➜ time understanding solidity so like I'll
  • 00:38:28 ➜ have to like write it on paper and stuff
  • 00:38:30 ➜ like debugging like how
  • 00:38:32 ➜ this is more gas efficient and more
  • 00:38:35 ➜ and like I used to like
  • 00:38:38 ➜ being your tweets to like learn so I
  • 00:38:40 ➜ can't thank you for that your tweets and
  • 00:38:43 ➜ also want to thank them dead because
  • 00:38:45 ➜ like I was he I learned from him the one
  • 00:38:47 ➜ we attack from his Twitter Prince like
  • 00:38:49 ➜ you guys are a huge inspiration for me
  • 00:38:51 ➜ so like my question starts like this
  • 00:38:54 ➜ like
  • 00:38:56 ➜ um based on how gas is going in the
  • 00:39:00 ➜ contest like nobody cares about gas like
  • 00:39:03 ➜ the context even in Charlotte today they
  • 00:39:04 ➜ don't want like
  • 00:39:06 ➜ for the M Watsons to like focus on guys
  • 00:39:08 ➜ they wanted to find me jumps on her it's
  • 00:39:10 ➜ like you think it's better to be a
  • 00:39:12 ➜ private like how passion Visa like a
  • 00:39:15 ➜ kind of private auditor where like
  • 00:39:17 ➜ Harrison
  • 00:39:18 ➜ where you like
  • 00:39:20 ➜ you have to meet protocols and protocols
  • 00:39:22 ➜ to give them your yeah their project
  • 00:39:24 ➜ like their code base so you can like
  • 00:39:27 ➜ you can optimize the amount of money you
  • 00:39:28 ➜ make from gas other than submitting gas
  • 00:39:30 ➜ issues like you waste a lot of time
  • 00:39:32 ➜ Gathering the gas issues like from the
  • 00:39:35 ➜ contest with like let's say like 3000
  • 00:39:37 ➜ lines of code then you waste a lot of
  • 00:39:39 ➜ time and they pay you like a little
  • 00:39:40 ➜ amount of money and they have bought
  • 00:39:42 ➜ swear boss like find everything easily
  • 00:39:44 ➜ so like that's the first question like
  • 00:39:46 ➜ which is better is it like to be hunting
  • 00:39:48 ➜ on contests where they don't care about
  • 00:39:50 ➜ what you're doing and like try to beat
  • 00:39:51 ➜ yourself on Twitter where you can get
  • 00:39:53 ➜ the whole issue
  • 00:39:55 ➜ um the money in a huge like in a higher
  • 00:39:58 ➜ amount and my second question would be
  • 00:40:00 ➜ like
  • 00:40:01 ➜ based on how gas is like the ability
  • 00:40:03 ➜ makes it harder to understand what the
  • 00:40:05 ➜ function does like do you think it's
  • 00:40:08 ➜ better for a protocol to like do a gas
  • 00:40:11 ➜ optimization before
  • 00:40:13 ➜ they do an audit because I think gas gas
  • 00:40:16 ➜ optimizations like bring in bugs after
  • 00:40:19 ➜ like
  • 00:40:21 ➜ after they've been after you like if you
  • 00:40:24 ➜ finish auditing in other gas
  • 00:40:25 ➜ optimizations later like it brings inbox
  • 00:40:27 ➜ and I don't know how to like put the
  • 00:40:29 ➜ question but like which one do you think
  • 00:40:31 ➜ is better like having
  • 00:40:33 ➜ a gas optimization on a code base before
  • 00:40:35 ➜ or after
  • 00:40:37 ➜ um doing this and the high level audit
  • 00:40:41 ➜ it's like that's my question thank you
  • 00:40:43 ➜ oh thanks for the kind words by the way
  • 00:40:45 ➜ and great questions so the first
  • 00:40:47 ➜ question I would say that the problem is
  • 00:40:51 ➜ that code Arena doesn't have a big pool
  • 00:40:54 ➜ for for the gas optimization right but
  • 00:40:57 ➜ still uh the competition there is kind
  • 00:41:00 ➜ of low uh the
  • 00:41:02 ➜ the contest that I did the juice box it
  • 00:41:06 ➜ had only like 11 submissions for guys so
  • 00:41:09 ➜ that's that's quite low and I know a guy
  • 00:41:11 ➜ that only does gas optimizations on on
  • 00:41:14 ➜ code Arena and I think he earned like
  • 00:41:17 ➜ three three thousand dollars already so
  • 00:41:20 ➜ you can still you can still earn
  • 00:41:22 ➜ something and you know obviously the
  • 00:41:26 ➜ protocols will pay you more if you
  • 00:41:28 ➜ actually just perform a like a gas audit
  • 00:41:32 ➜ only
  • 00:41:34 ➜ but it depends you have to deliver Real
  • 00:41:36 ➜ Results right you can just say uncheck
  • 00:41:39 ➜ this block and then charge 38. but you
  • 00:41:43 ➜ know I believe if you do private audits
  • 00:41:47 ➜ you can you can basically do
  • 00:41:50 ➜ you can
  • 00:41:51 ➜ use the gas reports sort of to be unique
  • 00:41:54 ➜ right so many people just offer security
  • 00:41:58 ➜ audits but you can offer both and that
  • 00:42:01 ➜ that will make you unique and then the
  • 00:42:04 ➜ payouts will be bigger
  • 00:42:08 ➜ well what do you think Dad
  • 00:42:10 ➜ so uh yeah so for the first question I
  • 00:42:13 ➜ would say code Arena and Sherlock are
  • 00:42:15 ➜ great for entry-level Auditors right
  • 00:42:17 ➜ they know there's no check uh you don't
  • 00:42:19 ➜ need to be popular you don't need to
  • 00:42:21 ➜ find customers uh you can learn you can
  • 00:42:24 ➜ submit nothing and nothing happens to
  • 00:42:26 ➜ you they take all the liability etc etc
  • 00:42:28 ➜ so code Arena and Sherlock are really
  • 00:42:30 ➜ good for starting out now with that
  • 00:42:33 ➜ being said obviously I think we've
  • 00:42:34 ➜ discussed quite a few of the issues
  • 00:42:36 ➜ there and
  • 00:42:37 ➜ I I think I have not I have not really
  • 00:42:40 ➜ done any private audits so I can't
  • 00:42:42 ➜ really speak to this from experience but
  • 00:42:44 ➜ just by looking at what I'm seeing in my
  • 00:42:47 ➜ DMs because I have had you know projects
  • 00:42:49 ➜ reaching out to me and such
  • 00:42:51 ➜ that it would be a lot more lucrative to
  • 00:42:53 ➜ be in private auditing but as ours said
  • 00:42:56 ➜ you can't you know and just give them an
  • 00:42:59 ➜ unchecked blocks and charge 30 eat you
  • 00:43:01 ➜ need to really deliver results and it's
  • 00:43:04 ➜ going to be a lot more work liabilities
  • 00:43:06 ➜ on you etc etc
  • 00:43:07 ➜ so uh yeah I would say for the first
  • 00:43:11 ➜ question you're better off starting off
  • 00:43:12 ➜ with Katarina in Sherlock use those bugs
  • 00:43:17 ➜ and with everything to get better to get
  • 00:43:19 ➜ on the leaderboard get on Twitter start
  • 00:43:21 ➜ telling people what you found and uh you
  • 00:43:25 ➜ know really genuinely try to help people
  • 00:43:27 ➜ of the other Auditors and these
  • 00:43:29 ➜ protocols will eventually realize that
  • 00:43:31 ➜ and when the time is right they'll reach
  • 00:43:32 ➜ out to you and you can you know start
  • 00:43:35 ➜ doing your private auditing at that
  • 00:43:36 ➜ point that's that's my roadmap
  • 00:43:40 ➜ yeah definitely and though
  • 00:43:42 ➜ the second question I would say that
  • 00:43:45 ➜ first perform a gas audit and then a
  • 00:43:49 ➜ security audit because as we said that
  • 00:43:52 ➜ it may introduce some security risks so
  • 00:43:55 ➜ just it would be better to perform a gas
  • 00:43:58 ➜ audit and then a security audit
  • 00:44:02 ➜ more and more people coming up with gas
  • 00:44:04 ➜ platforms I think right now they truly
  • 00:44:08 ➜ have some some people are working
  • 00:44:10 ➜ together
  • 00:44:11 ➜ on the platform for that and we we're
  • 00:44:15 ➜ now trying to go over this old lady
  • 00:44:17 ➜ doing a code review and it's just so
  • 00:44:19 ➜ hard to audit discuss stuff
  • 00:44:22 ➜ you know and and I was even talking with
  • 00:44:24 ➜ VX most of some of the very complicated
  • 00:44:28 ➜ algorithms have been you know uh
  • 00:44:30 ➜ inspired by C implementations and so on
  • 00:44:34 ➜ but
  • 00:44:36 ➜ it's hard to audit that on the evm you
  • 00:44:38 ➜ know
  • 00:44:41 ➜ yeah definitely because you know not
  • 00:44:45 ➜ everyone knows you and simply right so
  • 00:44:48 ➜ there are many more deaths that just
  • 00:44:51 ➜ download it again it's harder to audit
  • 00:44:53 ➜ then if not enough people know assembly
  • 00:44:57 ➜ what is the coolest gas optimization
  • 00:45:02 ➜ oh
  • 00:45:03 ➜ that's a good one I really like bit
  • 00:45:07 ➜ shifting and all that personally
  • 00:45:08 ➜ shifting really
  • 00:45:10 ➜ a bit shifting anything with bits you
  • 00:45:12 ➜ know um I had one Twitter post where I
  • 00:45:15 ➜ optimized some you know if you had like
  • 00:45:17 ➜ some human eight mapping to a bull right
  • 00:45:20 ➜ you could just instead use it you know
  • 00:45:22 ➜ 256 and each one of those slots would
  • 00:45:24 ➜ represent one of those bullions right
  • 00:45:26 ➜ because you know AIDS Max number is 255.
  • 00:45:28 ➜ so
  • 00:45:29 ➜ um yeah something like that I really
  • 00:45:31 ➜ like those and I really like anything
  • 00:45:33 ➜ that involves math obviously my
  • 00:45:35 ➜ background's in mathematics so anything
  • 00:45:37 ➜ where yeah or that that optimization
  • 00:45:39 ➜ comes in is fun when we use bit shifting
  • 00:45:42 ➜ it's usually for type casting right um
  • 00:45:44 ➜ when trying to convert different types
  • 00:45:46 ➜ right
  • 00:45:48 ➜ this shifting wasn't the best way to say
  • 00:45:50 ➜ I was just saying dealing with bits in
  • 00:45:51 ➜ general okay
  • 00:45:53 ➜ but uh bit shifting this you know
  • 00:45:55 ➜ whenever you want to just shift these
  • 00:45:58 ➜ bits so if you have one bit in your in
  • 00:46:00 ➜ your zero slot and you move it to the to
  • 00:46:02 ➜ the first slot you know that's the same
  • 00:46:03 ➜ thing as multiplying it by two and you
  • 00:46:05 ➜ can do the same thing in the opposite
  • 00:46:06 ➜ direction for dividing for example but
  • 00:46:08 ➜ there's also places where it's not just
  • 00:46:10 ➜ two and you know you have a nice even
  • 00:46:13 ➜ number like a 10 or 100 and you can use
  • 00:46:15 ➜ it for something there potentially not
  • 00:46:17 ➜ always but definitely if you're dealing
  • 00:46:19 ➜ with a multiplier divide by two yeah
  • 00:46:20 ➜ what about you RC what is the coolest
  • 00:46:23 ➜ gas optimization
  • 00:46:25 ➜ dude I don't know to be honest I kind of
  • 00:46:28 ➜ hate bits but you can save a pretty
  • 00:46:31 ➜ amount of get pretty decent amount of
  • 00:46:32 ➜ gas there
  • 00:46:33 ➜ so yeah I don't know
  • 00:46:36 ➜ awesome Bros awesome you know what I
  • 00:46:38 ➜ mean this is really interesting and and
  • 00:46:41 ➜ I've been seeing this smart and smart
  • 00:46:43 ➜ implementation we just had a talk with
  • 00:46:45 ➜ zero wage and we went through you know
  • 00:46:47 ➜ the fine line between readability and
  • 00:46:49 ➜ gas optimization but also gets me a bit
  • 00:46:52 ➜ confusing because we're now walking to
  • 00:46:55 ➜ their shoes now we have stuff like it's
  • 00:46:58 ➜ subscriptions uh so we have different
  • 00:47:01 ➜ ways of you know passing data around
  • 00:47:05 ➜ it seems to me like this gas
  • 00:47:07 ➜ optimization is a really
  • 00:47:11 ➜ momentary trend on the evm you know
  • 00:47:19 ➜ what do you what do you mean by that
  • 00:47:21 ➜ by momentary Trend I mean that right now
  • 00:47:24 ➜ we care a lot about reducing gas because
  • 00:47:26 ➜ the network fees are really expensive
  • 00:47:28 ➜ but now we come in with new layer 2
  • 00:47:31 ➜ Solutions we're coming the ethereum is
  • 00:47:34 ➜ on this road map is walking should
  • 00:47:36 ➜ become cheap at some point in the future
  • 00:47:39 ➜ but ideally we're gonna start using you
  • 00:47:42 ➜ know different networks before so if
  • 00:47:45 ➜ you're not paying that much for the the
  • 00:47:47 ➜ transaction itself maybe doing the
  • 00:47:50 ➜ optimization is not so worth it
  • 00:47:54 ➜ yeah and that's that's nothing new I
  • 00:47:56 ➜ mean even back in
  • 00:47:57 ➜ the 90s and 80s and so forth they had
  • 00:47:59 ➜ optimizations for codes that you know
  • 00:48:01 ➜ today we don't think about optimizing
  • 00:48:03 ➜ you know in python or whatever because
  • 00:48:05 ➜ our Hardware has advanced so so much you
  • 00:48:08 ➜ know uh it's potentially possible I mean
  • 00:48:11 ➜ I wouldn't be surprised but at the same
  • 00:48:13 ➜ time as Arts was saying we only have a
  • 00:48:15 ➜ limited amount of
  • 00:48:16 ➜ computational capacity so unless that
  • 00:48:18 ➜ changes
  • 00:48:19 ➜ I would assume that it's always a
  • 00:48:21 ➜ necessity
  • 00:48:23 ➜ awesome guys you guys have questions
  • 00:48:29 ➜ um okay thank you very much
  • 00:48:32 ➜ thanks guys it's really it has it has
  • 00:48:35 ➜ been really insightful yeah so I really
  • 00:48:37 ➜ enjoyed it I learned a lot thank you
  • 00:48:39 ➜ guys this will be that's why I didn't
  • 00:48:41 ➜ ask any questions because like I was
  • 00:48:43 ➜ just receiving yeah and it's a really
  • 00:48:46 ➜ good I mean a really good guide into how
  • 00:48:48 ➜ to start looking and diving into gas and
  • 00:48:50 ➜ I'm gonna make a really nice Thread
  • 00:48:51 ➜ about this thank you so much guys you
  • 00:48:54 ➜ have any closing thoughts
  • 00:48:57 ➜ no just thank you for listening thank
  • 00:48:59 ➜ you for having us yeah thanks thank you
  • 00:49:02 ➜ very much to that and Miss thanks for
  • 00:49:04 ➜ hosting this and thanks everyone for
  • 00:49:06 ➜ coming thank you so much I hope that you
  • 00:49:09 ➜ learned something we learned a lot
  • 00:49:13 ➜ thank you so much thank you guys

About

In this panel, you will learn how to approach gas optimizations in a more efficient way. This includes ways to learn about gas optimization, how to advertise yourself as a gas optimizer, and the tooling and resources available.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published