New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Solidity: Introduction to Remix

BaseMon, Oct 9, 2023, 12:00 AM

Code smart contracts in Solidity using Remix IDE! Understand workspaces, deploy contracts, and utilize powerful plugins for seamless development. Get hands-on with exercises. 📚 Head to Base Camp for full courses on smart contract development: https://docs.base.org/base-camp/docs/welcome ✅ Subscribe to our channel here: https://www.youtube.com/@BuildonBase ► Build on Base: https://base.org ► Follow us on Twitter: https://twitter.com/buildonbase ► Join our Discord: https://base.org/discord

Transcript

in remix Ram exist is online IDE and as you can see we have workspaces so where a spaces is like categories where you can group different types of work like contracts scripts tests and other type of files we are going to create a new workspace and let's call it introduction to solidity okay as you can see you have Now the default or a space and the introduction to solid divorce space Okay so let's clean a bit let's remove all these files that we don't really need we delete and we delete and here in the contracts folder let's delete this also this one and let's stay with the storage so here in remix we have a smart contract and you can identify the smart contract because we have the extension dot soil so here this is the editor area here we can type and modify the contract okay then we have that terminal or common output area here or we can execute commands actually but also all the things that we do like deploying the smart contract can be shown here all the results can be shown here we can clean it okay now remix work thanks to some plugins everything in remix is a plugin so for instance for solidity this is the compiler if you see we have solidity compiler and also we had these deploy and run transactions these two tabs represent plugins okay solidity compiler and deploy and run transaction the deploy and run transactions is part of the remix engine and it can be disabled however the solidity compiler can be disabled you can deactivate it by clicking here and if you see the compiler disappear now to activate it again we say activate and then we have the solidity compiler plugin enable or active okay now we can select different compiler versions if we want to this is good for testing sometimes um different contracts are deployed with a specific and with a specific solidity version and what we need to do is to test that particular contract and it's easier here to Simply select the version and paste the code okay we can select a different language in this case we are only interested in solidity and then you can specify a ebm version we select the default and also you can say here that you want this to Auto compile when we do that every time the code editor changes it's gonna compile automatically without the need to click this button okay so let's say we change here now we put number two and let's see the compiler is a bit stock because it doesn't recognize what is happening so let's click again and as you can see there is an error let's fix the issue and let's click compile again and now you can see that it's working okay now we had to deploy and run transactions which is the other plugin that is part of the remix engine and here we can select different environments by default there is a JavaScript virtual machine that is running in the browser and then we have some test accounts that we can use just to deploy to this JavaScript virtual machine that is living in the browser so basically we can execute all the contracts directly in the browser and get a similar Behavior as we would have in mainnet obviously this is a simulation environment and we we would expect to get the same results but you need to consider that the conditions in mainnet might be different okay um let's say we want to deploy the contract we simply say deploy and as you can see when I deploy the contract a new deploy contract instance appear here

Automatic transcript — names and jargon may be misspelled.