Try it out in Remix!
ETHCC 7 · 11 Jul 2024 · 22:42
Rob Stupay gives a tour of what is new in Remix, the Solidity development environment. He shows Remix Desktop in beta, which works offline and saves to a local folder, and works with Hardhat and Foundry. He then covers the AI assistant that explains code and compiler errors, the QuickDapp plugin for building a simple front end for a deployed contract, contract pinning, a remote Vyper compiler, and zero-knowledge tooling with scripts and a GUI for proofs and keys. He says an official desktop release is planned for early September.
Speakers
Topics
From ETHCC 7, hosted by Ethereum France.
Transcript
But actually before I start, well now I'll start, but uh here here's a little the um remix on Franc. Oh no it didn't do it. Oh no I gotta go like that. Should do it. No.
Okay, I don't know. Maybe something's else going on. Okay, back to the back to the show. Okay. Well at least that. So we're gonna go over some new things going on in remix. Uh and um questions will be at the end. I can't see anyone now because of the spotlights. But first, uh the big news now is um desktop is now in beta, which is cool because you can now use remix offline when you're on the plane when you're in a conference and the internet doesn't work, and uh and in areas of low internet.
Um so this is like it looks like remix normally, but uh each folder is gonna be its own instance of remix. So it's kind of like VS Code. Like each folder is gonna be a different uh instance of VS Code. Uh and so this is like when you load it up that folder, and then uh you get access to the terminal because it's in your uh computer. And you can have lots of terminals going there just like in VS Code. But it's remix. So then now you can see that it remix is online here.
But if you were to uh first uh download some Solidity compilers, so you prepared, and you can go do that in the Solidity compiler on the desktop version. And then you go offline and you do the work. Um and you can tell you're offline because that little thing is red. Uh you can uh and you save your work not to browser storage. Like uh we always get some complaints that people you know think that browser storage is pretty solid, but you know, when you lose your work, it's not that solid. So in using remix, because there are no accounts, you should either be pushing to an external repo or sharing a folder on your hard drive with remix D, or using Remix desktop.
And remix desktop, it just saves to your hard drive, so uh it's as secure as your hard drive is. So as I said, uh it's saved in your folder, and it's each instance is uh an instance of remix. So here's like a page of like five remix folder instances up there, and each one's a separate folder. Uh and so you can also just use uh VS Code and then just use Remix for the the Web3 tools. So uh like if you save something in VS Code, it'll just appear on the Remix side.
I just put a little comment over. No, I don't have a little pointer here. Oh well. Uh so uh it's the same, it's the same piece of code. And uh, but there's no browser wallet. So uh you could like connect Remix D to, you know, from the IDE and uh connect it to the same folder that you're using on desktop, but we're probably gonna make a bridge so that'll be coming soon. And you can use hardhat and foundry with remix when you use uh when you point remix uh desktop to the hardhat or foundry folder. And so when you compile uh something in in remix and you just click the uh button, I think if you go like this, that button there, then it's gonna make this file uh where is that file?
It's gonna make the compiler config file in hardhat. And then uh or you can just uh compile it and what am I saying? Yeah. Anyway, it'll make it for hardhat. And then uh once it's compiled in hardhat or in foundry, you can grab the compilation result in remix. And so you can kind of like mix and match your tools and use the tools that you want. You could you know get grab the compilation result in from some foundry compilation and then use the remix debugger. Uh and coming soon because uh is the official release, which will probably be in September, beginning of September.
And um uh because it's running on the desktop, it has more horsepower than the browser and more RAM and everything. So it's gonna be uh really good for running ZK proofs. And also uh we have a Viper compiler, which is a remote compiler now in the Viper plugin, which I'll give you a little taste of later. And uh, but you could do Viper compilation locally uh using Remix Desktop. So uh this is the beta to if you want to download the beta of that. Anyway, it's in this um uh it's in the remix dash project.org.
It's not in our usual repo. Uh so the next one we're gonna go over is AI in uh remix. Um so uh there's uh parts of AI which are like explanations of code, like hitting the robot icon there, and then you can explain this contract, which is good if you look at a contract and you don't understand. So this means you can like grab some contract from some repo by cloning it into remix or by using like a cookbook and grabbing it in, and then like you're looking at it and getting the AI to help explain it to you. And so then it'll explain it to you in the terminal.
Also it'll give you uh AI support for compiler errors. And then those answers of like explanations are also in the terminal. And if you right click on some code, then you can uh either have the AI generate some documentation for the code, or you can uh try a different. And we're back.
Wow, it's like incredible shadow off my glasses onto the screen and back to you. So uh yeah, you can generate some documentation, you can explain a function, and you can just uh explain a little piece of code. Oh, thank you. Much better. Uh and you can get uh assistance in the terminal. So you can just ask, solve GPT and then ask your question, or just GPT ask your question. And this is using our own uh language model, which we uh it's like a cloned of a Solidity language model, so it's you know very Solidity focused. And the answers come in the terminal.
Uh and then you can also uh get code assistance on request with a triple slash uh in the editor. So you know, like write a function that you know returns an array or something like that, or whatever you want to do. But to do that, you have to turn the uh the AI on uh with uh the switch over here. That's the uh remix AI switch, which is for code completion or assistance with this triple click. Uh the it's gonna be here. Uh yeah, so if you ask it to like write you a contract, is this contract gonna be uh not full of security holes?
So we're gonna we enhance the remix AI with some uh by passing it through Slither. So before it gets returned, hopefully the uh security holes have been plugged up. Or it won't return those if it has some security holes. Uh and each time you make a request, it'll give you a different answer. So um, uh I think you can tell. Anyway, it it's kind of interesting, like it'll just keep proposing different answers each time you ask, and it takes into account what's above and below on that file. Uh and you can also turn it off with when you're typing, it doesn't bug you.
Oh, this is for like when you um when you're coding uh and you uh make a space or a return with the copilot turned on, it'll propose some uh some code. So uh, and if you don't like it, you don't accept it. And if you make another space, it'll propose another bit of code. And that's the uh switch again, and that's the code completion, which I was talking about. So it's proposing a few different things for me here. There's slight variations, but um you know you could uh you could tune it a bit. So coming next uh Tuesday in the next release, we're updating the git plugin in remix.
It'll always be on. So this is uh important for all you people who want to make sure that your repos, your code is pushed to an external repo, which really should be everyone. Uh so um I'll just go over that. So when you you you log into you can log into GitHub from Remix, and then uh, you know, it has the standard uh get commands that you can run here. It's kind of like getLens. So um it should cover most of your basic commands. It won't cover things like cherry picking or rebasing, but uh it does the basic stuff.
And if you need to do those, you should probably just use the terminal. Uh and so uh yeah, this is the pushing and pulling. Uh the cool thing here is that we've got it so that it all the commits, the you'll see the commit history, and uh if you click on the commit history, you can see the diff. And uh you can there's branch management, and also in the file explorer, there's branch management at the bottom. So uh yeah.
And of course you can fetch repos. And you can do that from the hamburger icon in the file explorer. Thought we went over that. Uh so we have another part of remix, which might help in especially for hackathon workflows, where after you make your application or your uh contract and you want to make uh just a basic front end to show the judges, you can now do this in remix. There was a, we had a plugin called OneClick DAP, and now we have a new one called uh QuickDAP. And uh so it has to be deployed on a public network.
And then uh, oh look, another thing that recently came in is the pinning. Now you can any uh contract you like on any network, you can pin it and it will come back the next time you go to that network. So that means that uh when you deploy something, even on a local VM and you forget where it was or uh uh whatever, you can retrieve it. Uh and so anyway, for Quick DAP, you um it has to be public network, and then you open up the deployed instance, and uh you get this little icon here on the right side of the screen, the little edit icon. So I was using this example because there's like a million uh functions here, or you know, at least more than a few.
And often you don't want to show some client or a judge or whatever, all this stuff. So uh when you open up Quick DAP, it shows everything, and then you can just uh close the functions that you don't want to show the person. And then you can drag them into three columns. And then there's some administration stuff on the right side here. It deploys the DAP to Surge, and you get to choose your um subdomain of Surge. And it's a free search is free, and it they don't even check your email and password, and so you can just keep creating emails and passwords.
It's uh it's a nice service. Uh and uh what else? Oh yeah, if you have a verified contract soon, you'll be able to uh have people in your DAP, because here, I'll get to the DAP part. Uh here, then you verify it, and then uh here, and actually a little sidetrack. That uh in this case, like I chose uh the subdomain herring, but it was taken, so I did a Bob token, and then that worked. You just have to always make sure that you scroll down to the bottom to be able to see like the result, the success or the failure of your deployment.
And then when you go to quick uh DAP, this is still in remix, you can you know uh give your DAP a title, you can name your functions and give them some descriptions. So you're giving your users a little bit of uh care and um you know make things a little bit uh maybe more intuitive or so you don't have to hold their hand the whole time. And then you get this URL, and you go to that URL, and this is kind of what it looks like. The view your uh source code is good like for hackathon judges who might want to check out your code, so then they they'll be able to open up the uh source files in remix from a verified contract.
That's coming uh probably in a week. Uh and this is a simple one, just uh I just did the uh one the from the default uh contracts in remix just to show what a really simple one looks like in case you wanted to go there and check it out. It also works it should work in a mobile device too. Now in remix we have a right panel. Before it was always left panel, main panel and uh icon panel. But now we realize like when you're doing a tutorial and you're on learneth which I hope everyone knows about does anyone not ah it's a uh tutorial I'll go into it a little bit more later but it's uh uh it's a tutorial plugin and uh you can um well I'll talk about it in a few minutes not too many more minutes though uh but anyway so if you're following instructions in the left panel and you want to do something then you have to keep swapping out the right and left panel but if you click that icon there then blah okay it turns on the right side and you you can have two multiple things going on which you know it's works great for learn it it would also be very good for uh the debugger so here's a bit more about learneth these are like the current learnth tutorials we have a couple uh outside projects that is something from uh we have a Uniswap explainer and uh something from XLR so it be could become a very good dev rel tool and these are just made by simple uh markdown files and you can also have external repos you don't need to use ours so you can have a a class and have your make your own learneth tutorials and direct your students or your people that you want to teach here.
And then you could also have a remix specific URL, I mean with some parameters that will load learneth, load the repo, and give them and load the specific step in the repo of the tutorial that you want them to go to. Also, you can try out Viper, ZKSync, and Cairo. They're separate plugins for each of these. As I said, uh the Viper is a remote compiler, and uh the ZK Sync and Cairo are, well, they're in use now. Uh if you want to try out a whole lot of uh contracts, you should use the uh cookbook that uh cookbook plugin, and there's even some AI in that plugin that can help uh find you the contract you're looking for.
And that will also open up the cookbook site, and then from the cook site, you can have even more indexes of more contracts to play around with. And then you can go back to remix and deploy. Uh and we're gonna have a more uh templates coming into remix quite soon. They'll be in the main panel, so it's not won't be just the little uh central and side panel choice of uh of templates. It'll be quite a number of them. Uh we've also uh updated the VM.
Uh, just a few minutes left. Here, I'll spin through this a bit faster. Uh you can now save the state in the VM and you can share the state with a colleague. Of course, you can fork, we had that before. Uh what else? Oh, yeah, and you I hope you all know about the ephemery test net, which is a great net for get uh network for using uh because it refreshes every month, so it means it's easy to get the test ETH. So this is uh how to do a the custom fork. Uh but beyond the remix VM, you can use Build Bear or Build Bear plugin.
So you can spin up a private net with a faucet and an uh uh block explorer. Uh it's a cool extension into remix. And a lot of people use think remix as a kind of point and click tool, but you can also run a lot of scripts in remix. So you can use the scripts to set the state, you can uh, and it's easy to run a script, you can do a compile and run for setting the state, compiling, and then the script automatically runs to get it where you want to be. Uh it's easy to set up a script, there's even the console.log.
Uh, and you can have scripts for deployment, compile and deploy, there's scripts for mocha testing, and unit tests, and more unit tests, and for contract verification. I got 90 seconds left, and I'm gonna use them. Uh you can get, yeah, for contract verification. Actually, we're gonna be updating contract verification, so it's gonna be even more streamlined, so you can just verify very easily to multiple uh verifiers. Uh and we have the uh Circom plugin in Remix, which at the moment is a kind of work in progress, but it's gonna be, we're aiming it to be like this ZK education tool.
Uh because as you know, if you tried anything with ZK, it's a little complicated. Uh so anyway, we have some templates here, and then we have the you can run some scripts to uh generate the proofs and generate the keys and generate witnesses, but there's also a GUI, which is a nice addition, and this is going to be expanded uh quite soon so that you can have the more the trusted setup, the proof generation, and um a hash generator, which is always a pain if you need to generate a hash and you forget how to do it. Uh also because this is in the browser.
I mean, uh the ZK stuff is gonna fit very well with uh desktop, but in the browser uh often needs a little more horsepower so you can use this Sindri uh scripts, which are accessed from the hamburger menu. And that's it. Thank you.
Thanks a lot. Give me a read done, give me a read up, give me a read done.
Related talks
- Cyfrin Updraft: Full-Stack Web3 Development Crash Course
- Fireside Chat with Austin Griffith
- Remix Features You Need To Know
- Zero To Dapp
- Intro to Remix
- How to Vibe Code a Mini App on Celo
- El camino del VibeCoder: Universitarios en Web3
- Building on Ethereum Human vs AI — Who Wins I Kevin Jones
- AI x Ethereum: where we are now