Development Environment
To get started, we will learn solidity as a language. We won’t begin with deploying contracts on the blockchain, that will just make things more complicated.
Head over to remix.ethereum.org
You are strongly encouraged to use Remix to follow along with the examples in this course.
Let’s create a hello world.
contract ExampleContract {
function helloWorld()
public
pure
returns (uint256) {
return 100;
}
function haloDunia()
public
pure
returns (bool) {
return true;
}
}
After you go to remix.ethereum.org, right click contracts and left click “New File”
This is a solidity file, so give the file a .sol extension. The name is not important
Copy the code from above, or better yet, type it out yourself.
To compile the code, hit Command S on mac (CTRL S on Windows). If you see a red bubble above the solidity symbol, you have a syntax error. if you see orange, you only have warnings which you can ignore for now.
Now deploy the functions. Click the Ethereum symbol on the left, then click deploy.
To test the functions, scroll down on the left menu, then click on them. They will return the values you expect them to.
What if we want to make changes? Delete the contract with by clicking the trash icon.
Now change the code, recompile with command S, then click deploy. Test the functions again.
If a function requires an argument, it will be supplied next to the button.
You are now ready to experiment with Solidity smart contracts!
Learn more with RareSkills
See our Solidity bootcamp to learn more about smart contract development and token standards.