Earn While Learning Web3 Programming>> Start Here FREE!!!
EXERCISE: Write and Deploy Your First Solidity Smart Contract:
i. Named "HelloWeb3World"
ii. Deploy and have it Return "Hello Web3 World" in Remix
iii. Post your SC code in this forum
iv. Share your experience like errors and challenges first time coding smart contract with solidity
NOTE:
This Is An Exercise From Our FREE Smart Contract Development With Solidity For Beginners Course (If you have not enrolled yet, you can join the course totally for FREE).
See my question getting responses like this actually make me fill like I am in actual school with a teach . This give the drive to wonting to learn because I know once I got stoked I have some that will always put me through .
Once again Sir I said thank you very much for everything.
@leouloko this is just the beginning. Am giving this project 101% attention and in it FULL TIME to Mint at least 1Million Web3 Programmers before 2024 that Web3 is going mainstream.
So, be assured, you got someone on ground to support every courses that will be released on this platform henceforth.
I believe you will see helpful solidity smart contracts examples below from our students but in case none yet. Then, check a solidity smart contract example I wrote myself.
pragma solidity 0.8.7;
contract howslidityiswriten{
function helloweb3world() public view returns(string memory){
return "helloweb3world";
}
}
//in my case instead of returns(string memory)
i wrote return(string memory)
it took me more than an hour with out knowing where the error was coming from. i have to start afresh before i noticed there was no s in the return
@leouloko interesting, I did same mistake in my first attempt and the reason I do encourage my students to not just watch me code in the course videos but follow me and try to re-write the code themselves.
Errors like this can not be detected just watching videos but only when you write the code yourself. And such stick to your brain for life helping you ensure you can easily spot and correct the errors in future faster within 5minutes or less instead of 1hour+ spent the first time you experience it....good job
Now to your code, see my comment on it below
@leouloko I replied you previously via mobile and seems to screw things up that makes the display horrible but now corrected.
pragma solidity 0.8.7;
contract howslidityiswriten{
function helloweb3world() public view returns(string memory){
return "helloweb3world";}
}
My comments
(1) your name style is hard to read. You need to improve on it and it has to be now that you are starting as a beginner not later so it becomes part of your coding attitude.
Don't use lower case for multiple words.
function helloweb3world
should be
function helloWeb3World
Or
function hello_web3_world
You will notice the last two are much easier to read if you have like 1000 lines of code that all lowercase. So important please
(2) Check spelling errors. I do this mistakes too even till now but we all learning and am improving on it too, so do take note as well
contract howslidityiswritten {
}
Misses "o" on solidity
and better rewritten as:
contract howSolidityIsWritten {
}
return "helloweb3world";
return "Hello Web3 World";
Thank you sir.
@joshua cool 👍 .
The license is okay too. It may be GPL-3.0 or MIT if the code is open-source. You can read about each license to know which to use for a production smart contract