Remix Features You Need To Know
ETHCC 6 · July 2023 · 15:45
Rob Stupay demonstrates Remix features for learners, educators, experienced developers and project leaders. The speaker shares practical tips for working with the development environment at different levels of experience.
Speakers
Topics
From ETHCC 6, hosted by Ethereum France.
Transcript
[Applause] hello everyone this is on it's on yeah uh hi I'm Rob stupid uh I work at remix um so I've been giving some remix lectures now and again and often online and when you're given the lecture online you see the screen and you don't see the audience and hey Paul and no one asks any questions uh because it's online and so I rattle on and on and on so uh you know stop me uh I got 15 minutes starts now uh and uh anyway let's begin so um I divided these remix features
into three qualities for beginners intermediates and kind of project leaders you know it's like uh remix is often used by beginners because it's the easiest place to start uh intermediate devs use remix for lots of reasons and advanced devs uh often are just maybe not Advanced devs but just project managers need to keep track of what's going on and there's some good Tools in remix for that um so uh there's also like features and remix that I think everyone should be looking at or know about and when talking to devs we find out they don't so like um first of all just so we have this
speaking the same language you know that's the main panel there's a side panel and the icon panel everyone knows that right I got also if you're getting bored I can speed up faster so let me know if uh so did you know you could find the docs inside of every plugin you just dial down that it's not a pointer but it's a clicker uh you dial down that little carrot at the top right and then of a side panel and then you get a link to the docs and then uh we moved the uh to start it we put the workspace tools inside the hamburger icon at the top of every side panel plugin so to get to the workspace
tools you click the hamburger and you get this big menu and two ones that are everyone should know about the top or how to clone a repo has everyone cloned to repo and remix no at least some some of you have it's kind of new and uh it's wonderful uh also creating workspaces is important because uh you get all these uh templates and these are going to be ever increasing number of templates and the open Zeppelin templates you can choose different features of these uh erc20 or 721 or 1155 templates and you can also initialize every
template forget and gets important because you have to know where files are getting saved in remix we often get people saying I don't know where my files went and that's because it's not being backed up on a server it's in local storage uh everyone knows that good uh and that's a a workspace with a little get icon because it's been get initialized and does everyone know about remix d uh good so I'm going to whip through this this is how to connect remix to your hard drive and it's a npm script you run it and um then you run this command remix D and then it connects it and then oh it's
much better over here what happened okay open it went away it's over oh okay good uh so then uh when you when you're working with Git You can manage your branches in the file explorer at the bottom you click that and all the branches come up and then you launch the decant plugin and you get all the good all the git operations and it's just like in if you're doing that in vs code uh uh it's the same kind of interface and there's even um you got to put in your GitHub settings and then you can see the changes if you you can check the diff inside remix uh so uh go do that also now there's four ways to
compile a file you know so whichever one you want to do do you can either go to the solidity compiler you can do control s to that will launch the the compilation you can right click in the file explorer and you can hit the play button you know you can also use the play button for running scripts in remix typescript or JavaScript scripts uh and the right click menu this there's all these choices here I don't know if everyone's seen all these choices but you should look at them that's how you flatten uh and you can generate uml and generate documents uh we'll go into uml a little bit later uh and then we can fork and remix uh you can park mainnet any net and you
can put even in the um custom Fork oh I guess I'm going to go into that later but uh forking is possible uh and more everyone knows how to verify in remix oh very important so either you can verify with sourceify you know about sourceify everybody okay there's a source if I plug in there's an etherscan plugin these are the names of the plug-in contract verification sourceify contract verification etherscan and you can also just do nothing and publish your uh your uh source code uh but I'll show you how to do that in a sec this is the with
the sourceify plugin looks like you click the verifier and then that opens up and then you put in your contract and you verify it uh etherscan is uh you have to put the ether skin API key in first sourceify doesn't need an API key and then you can um verify it but you can also verify the proxy contracts associated with a uups implementation of a proxy um so once you click that you can there'll be a little bit more UI uh but also here in deploy and run if you click that publish to ipf ipfs button and you have like a a impura
account then you'll publish to your your source code to ipfs and then sourceify has its monitoring service and it will just verify your contracts so you don't really need to do anything you don't need to go to any plugin you just publish your your data along with your deployments and sourceify will run around and get all your verification done for you uh and has everyone used the ad address here good but somehow I feel it's not being used enough so you just need to have your metadata your uh the metadata uh the API sorry and in remix and
or the compiled contract and you can use add address and then you can interact with the deployed contract foreign am I going too fast for anyone I am okay okay uh tutorial says everyone tried Learners tutorials and remix good well good for the people who have anyway uh so when you launch you go to the uh plugin manager or click on one of those links on the home page and there's all these tutorials in here uh and they're step-by-step tutorials there's also solidity unit tests so like this is the solidity beginner course uh
there's the answers there's they'll check your answer with a solidity unit test and you can see the answer and uh they're based on solidity by example that website so you can go over here read our how we describe it then go to their site and see how he describes it um and then also we've translated these uh the tutorials into Spanish and to uh simplified Chinese and also uh remix itself can be seen in Chinese we're going to be expanding the UI into uh Spanish and uh a number of other languages too uh so that's on the bottom of the
settings panel is where you switch a language and then you can see remix in Chinese and then the docs similarly a little hard to find but if you go to that thing at the bottom of the docks read the docs uh well the language's language choice will come up and uh now another subject is uh autocompletes on Imports so when you're importing a file and you start typing uh at then you can it'll auto complete uh open Zeppelin library or uniswap or any of your local files and uh has anyone had trouble importing with remix
so you really should just be um you know if you use the import it'll grab you don't need to have the long string you can just put the import any open Zeppelin contract or any contract that's in npm and it will go out and grab it and bring it into remix so it it should be uh pretty seamless uh you can also import via the entire you know https URL but it's often quite easy just to do the uh import statement and grab it from npm and also here's a kind of little trick for grabbing a URL in uh etherscan you just take the etherscan URL of a verified contract and then you
switch out uh etherscan for remix and then it pops it up in the remix editor so it's a little quick switcheroo and as everyone tried console log and remix good there's an example of it in one of the default programs in the default template so for intermediate devs got about 10 minutes five minutes left three okay uh intermediate devs compile and run is a way to uh you set the state with a compilations with a script and then you hit the skip script you hit the compile and then it'll run the
script so it will set the state of your contract uh which is uh nicer you can code and then set the state and go to the problem and then rerun it again um and just run it when you want uh there's a transaction recorder for in the deploy and run uh for for uh getting all the transactions and you can um save your transactions and give this it makes a Json file and then you can give this file to somebody and then they can run your transactions uh in their their remix and uh so you can kind of share and coordinate problems it's good for it's a good teaching tool and now there's a gas estimates inline
in remix I didn't know if everyone knew that did you know that good good good and scientific notation and remix in function inputs that's a no and also you can run free functions actually have you all tried uh right clicking in the editor recently because we've updated it I don't know three or four months ago so uh you know you can go to definitions and references but you can also run a free function and uh but you can also format a code code there and you can set the formatting in the prettier config file in the file explorer uh and also you can um we've updated the UI for proxy contracts using the uups
pattern so when you have one it'll make two deployments one right after the other and if you're just deploying to the remix VM it just kind of does one right the other if you're deploying with uh you know injected web3 metamask or something you're gonna go it'll you'll have to do two approvals um which is these two approvals and then you interact with the proxy not with the implementation contract and you can um have you anyone tried to uh grab a hard hat or a Foundry uh compilation result and deploy and remix ah you can
you can if you uh it'll grab the well this is a compilation and for uh you can compile and remix and then it's visible in hard hat and uh here's the uh compiled by remix or compiled by hard hat or Foundry whatever it'll grab it in the deploy and run uh and uh We've updated the static analysis so that you can do the linting and uh uh Slither Slither is interesting because when as soon as you run remix D it'll install Slither then you can do all your Slither analysis inside the solidity analyzers uh I think I'm gonna just skip ahead
here because uh it's important to know uh your code liability your liability as developers and it's maybe I've heard him with Mika that uh uh devs are going to start becoming liable so it's important to be able to maybe give your your clients the code in remix to deploy so they're going to be deploying with their Wallet not with your wallet and then you have you've reduced your liability dramatically so remix can be a good tool to work with the new regulations coming in the EU and then you just give them a gist the clients adjust or something like that
and then you get this long string and um but with it just just equals with the remix URL will load the gist into remix also here's a an interesting page of um your remix URLs so you can config remix via the URL for yourself your students your co-workers to load different things to load different plugins to load different files and that's it okay thank you very much Rob and thank you very much everybody
um I'm sorry but we don't have time for a question time flies and we have a schedule to follow so sorry to ask you a question directly to rubia [Music] foreign