Remix Interoperates

EDCON 2021 · 27 Aug 2021 · 14:38

Rob Stupay and Aniket demonstrate Remix's integrations with other Ethereum development tools. They cover local-file access through Remixd, OpenZeppelin's contract wizard, WalletConnect and a VS Code extension, then show Hardhat compilation and Slither analysis as part of connected smart-contract development workflows.

Speakers

Topics

From EDCON 2021, hosted by EDCON.

Transcript

hello edcon uh we uh aniket uh and i rob stupay work at uh remix and we're giving a talk about how remix works with other projects so um remix is uh dedicated to helping you develop your smart contracts and to using the best tools out there and to mix and match how you want to use these tools so i'm going to go through how how you can use some of these tools inside a remix but the first thing to know is an essential ingredient which is remix d which remix d connects a folder on your computer with uh with remix.ethereum.org the website so that means you can save files on your

computer you can use version control on that folder you can clone repos into that folder and have them appear on the website on the remix dot ethereum.org website uh also allows larger repos because there's a limitation to how many full files you can stick into remix before the local storage runs out of space anyway you get this at npm and install that it's generally a good thing to have um whoops okay so another tool is the open zeppelin wizard where you can customize a erc

20 or 721 or 1155 contracts and then click this button and then they'll open it up and remix and then you can start playing with them and deploying them and using them further and another interesting tool we got is a a plugin for wallet connect so this allows that you can uh use you can approve transactions on your phone as long as it's a you know wallet connect enabled wallet on your phone and it means that you can and if that that wallet is connected to uh testnet then uh you can improve transactions on test nets and have them

the transaction that's uh generated from remix and this will be a it's a cool addition for remix but it's also you can use this from the remix desktop version i assume you all know about remix desktop if you don't and you want to run your mix from a as a desktop app you can get that but also coming up is is is there uh the new uh vs code extension for remix so this means uh you can run remix inside of vs code so a lot of you or maybe all of you are using vs code from a lot of your programming and now you can have this extension and run remix from inside of vs code and you get

it from the vs code marketplace and just search that uh ethereum remix for that or uh go to the this the website the marketplace website and you can get it there uh the overview of how this works is um you'll once you get a workspace going in in vs code and you click the extension uh you'll get the core functionality of remix here the plugins down here you should go through the plugins and check them out but these are basically the same plugins that are appearing in remix uh your code is up here and the output down here is what will be appearing in what would usually appear in the remix

terminal and uh on the right side which you'll see in a few minutes is where the plugins go uh again here's the core parts of remix and here are the the plugins and if you're in the file explorer of vs code we've snuck the the remix menu down here so uh it's easy to get at so if you want to compile you click compile if you want to select the compiler version uh and then uh it's all pretty straightforward so here's compiling the compiler um uh well actually this isn't the compiler but what happens here is if you when you want to compile uh it vs code will

our extension will go out and grab the dependencies and the imports just like a remix does and it imports in the same style as a truffle or hard hat so you can mix and match and deploying is cool uh you can deploy to local chains like ganache or truffle just by uh clicking here you can connect to the in browser jsvm chain on remix.ethereum.org or you can actually connect with metamask which is a huge uh uh cool thing to do i'll show you how to do that in a couple of minutes uh but you can also connect with wallet connect

uh once you've deployed uh and you've connect once you've connected your account your your exchange to run and deploy you'll see your uh address here and like if you were in truffle uh sorry ganache you clicked that and all the addresses would pop up and then when you want to run a transaction you see all the functions and you can interact with them and debugging is simple as well you just put the transaction hash click debugging start debugger and you get the remix debugger inside of vs code and then to use the remix d client to connect to the

in-browser chain or to use metamask you could click either here on the side or you connect to connect to remix and then when you do that you have to connect your remix so you go to remix.ethereum.org and go to the file explorer and collect connect to the uh local host which will start up which will show you what folder you're working with on your hard drive and then in the run and deploy tab of remix you'd select the environment the injected web 3 environment and then whatever the uh chain is that metamask is connected to uh it will appear here but then on the vs code side you'll see it over here

and you'll also see your address and then once you make a transaction in the vs code the metamask will pop up on the browser and ask you to confirm the transaction uh another cool thing we've started to do outside this is not about vs code but it's about digit it's a new plugin that we've got that helps manage um version control so um you know in the browser people lose their work because if the browser crashes and you lose your local storage uh you lose your work so uh and also you just have to know that all the

computation and storage is happening in the browser unless you're using remix d but if you're not using remix d it's really you should use the new dkit plugin so it turns um any workspace any remix workspace into a separate git repo and then you can export those repos download them to your computer and upload them to github if you want to work that way or you can export them to ipfs and pin them as a repo on pinata i'll go over that a little bit more in a second but um uh yeah so basically you can download your your files and i just uh basically went over the slide but you can it's

it's a great tool for uh collaboration as well because you can export your repos to pinata on ipfs and someone else can import them or you can just uh export your repos to ipfs and if your browser crashes you have a backup so this is what it looks like it's a main panel plugin and the files are uh there are a bunch of tabs here you add uh get tracking on the files tab you download it in the files tab the help tab has the complete documentation and uh the get tab is where you would um do the commits uh here's the export tab where you would export it to pinata

um uh and you set up the pinata with it with the api keys in the settings for pinata and now on to any cat to talk about hard hat and slither thanks rob so uh apart from these things we have also integrated some things from the hard hat and we will talk about that now the next slide drop so first thing is the harder compilation that we have integrated with the remix solidity compiler plugin so you can connect the remix id using your remix d plugin yeah which basically runs locally

it connects your local folder with the remix id and once you are connected there make sure that your shared project is a hardhat project and if that everything is fine so you will see a check box coming in this solidity compiler plugin which will have the label enable harder complete compilation and you can just check that box and run the compilation normally and then along with the remix compilation hardware compilation will also take place and you will know the status of this compilation in this remix terminal i'll add it in the second box so next slide yeah another one is uh

that you can deploy a contract to hardhat local node using the remix ide so basically hardhat provides a local network node using which you can deploy the content and test the things very quickly remix has integrated one plugin which is named hardhead provider so you can enable that plugin and you can select that from the environment from this deploy and then transactions plugin and then there will be a check box to enter that json rpc endpoint you can provide that endpoint and then you can normally deploy the contract directly to that hardware network node the one plus point is here that you can

easily interact with the deployed contract using remix id itself yeah next uh slider yeah this is a kind of one more interesting feature from the cons hardhat side so basically hardware provides a console library which enables the user to use the console.log as we do in the other languages so you can just import that library which is on the top box which is shown in the top box import hardhat console.solve and then you can use the console.log statement usually to print the messages or the value in the contract and whenever you will interact with those methods corresponding logs

will be printed in the remix terminal so you can see that in the third box highlighted here yeah next uh slider similarly these uh logging can be used in the solid unit testing plugin so that can be a great thing when you are writing the unit test for your smart contract you can just add some logs to check the values like it is shown in the first block that we have written our two console logs in the test case and then when you will run that test test case it will show those logs in the remix terminal itself so it will also be

containing the test name so that you can be clear that uh for which test case these logs are so next slide yeah another integration is from the slider so slider is basically a solidity static core analysis tool and to use it we need some prerequisites installed on your system locally so because slider is a cli tool you need to install it locally on your system along with the salsi and sources select because it works with that so you need to connect your project with the remix id using the remix d as we have done for the harder compilation

and then there will be this new checkbox with the label enable slider analysis you can check this box and then run the analysis normally so you will further see the analysis report generated by the slider in the same plug-in ui below one another thing is that that when we run this analysis for slider we use the compiler configuration from the solidity compiler plugin and we know that solidity is installed without one fixed version so we use the sources select if there is a version mismatched from local salsa version and version selected in the solidity compiler plugin so you will know about this process in

the remix d console also that your version is different from the installed source version and then the required version will be installed and set using the sources select so yeah next slide yeah so as we are in crunch of time here so you can look at these resources for more information about the integrations these resources are mostly from remix id official documentation and the medium publication and here are some communication links that can be used for to reach out to remix people in case of any feedback or suggestions and thanks for your time