# How Much Gas Does It Use Interacting With this Smart Contract? by Jacek Varky (Devcon5)

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2020-10-09
- Duration: 03:48
- Topics: blockchain, smart contracts, distributed ledger, ethereum
- Watch: https://streameth.org/watch/yt-Dmt6wnbeV2M
- YouTube: https://www.youtube.com/watch?v=Dmt6wnbeV2M

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more.
https://archive.devcon.org/archive/watch/5/how-much-gas-does-it-use-interacting-with-this-smart-contract

Developing a smart contract is easy. There are a lot of tutorials and examples on how to write a smart contract. In some cases, it is even possible to simply copy the code. Afterwards compile it, deploy it and let the users use it. But has it been optimized before the deployment or does it waste the user’s gas?We present a tool which analyzes the bytecode of a deployed smart contract based on the rules presented in Chen et al. (2018): “Towards Saving Money in Using Smart Contracts”. A user can enter a transaction hash and the tool reveals if the smart contract has been optimized. For non-optimized cases the user sees how much gas is wasted by using the functions. The estimation is based on the analysis of the OP codes. Thus, is not necessary to provide the ABI or the source code. This gives users the possibility to verify that smart contracts do not use too much gas and forces developers to optimize their smart contracts. 

Speaker(s): Jacek Varky
Skill level: Beginner
Track: Developer Infrastructure


Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 5 was held in Osaka, Japan on Oct 8 - 11, 2019.
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

[Applause] alright so we just heard that delighted to toxic artists are know so I'm at the market I'll start the first one where I'm going to present you to UVM hunter to see you can only dance now what is it actually about it's a tool by which I'm going to introduce to you the first we have the Lord on some dad's here are some deaths from the Dead River and then you can see some things that the Raiders show that they're apparently 1,028 to the absolute history that might be more flying flowing around the chain but this is a number which is what just sit there and so we all know that executing the smart contract costs gannets whatever we like yeah the main question is which I also so myself have they mean optimize it or are they waste in your gas when you interact with them okay so that's the EDM actually steal your gas because the smart contract has been not optimized do you know what kind of code you're using there if you hate making more gas than you should have so we will actually a tool it looks like this here you have to be I'm not sure what you do is all you have to do is just type in the address of smart contract and it tells you gossip CQ ssin how much gossip waste actually the execution time and also how much gas and waste turned into wine in time so well what do you have to do is type in smart contractors will you meet me Tomas - it's okay we distribute it and you can see it can be Robson can be main that can be any network and you can just see how much of gas this smart contract is wasting so the idea is also to put pressure on the developers that they start to think hey I have to optimize smell my smart contracts because two people are able to see if I did a good work at all so yeah then for example what happens is possible to distinguish between an account or a smart contract so if you type in and wallet address with good oxygen someone just doesn't store any code Yahoo - tell me so on the other hand what is this - Lulu it retrieves the byte code from the chain analyzes it based on some hunt and any patterns which happened to the stripe in the paper and just gives you the result at the end so you might ask where do I find this tool you can find it either on their EP I'm not sure go buy both of the just a QR code if you want to test it out it is also github so under my evolve so feel free to extend this tool if you know any more patterns you know what you know we want to make school you maybe you better it's something that's feel free to contribute and make use of it thank you [Applause]
