From the course: Blockchain: Learning Solidity
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Basic syntax of a contract
From the course: Blockchain: Learning Solidity
Basic syntax of a contract
- [Instructor] Contracts in Solidity are very similar to classes in object-oriented languages. They can contain state variables, functions, events, struct types, and enum types. And as we go through the syntax, we'll explore each one. So let's explore our example that we got started previously and expand on it. So just as a FYI, if you wonder why we're still having an error here, it's because it can't find the file name. We don't have any file name here. So two things you could do. Either you leave as is and you're okay with the error or you can just comment the whole thing and keep the code as an example. At least the file doesn't have that error here. All right, so once we have that, let's go ahead and start building our contract. So what we're going to do in this simple contract first, we're going to state a variable. So let me show you how to do this. And again, I'm going to write a note for all of these so you can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Solidity syntax basics5m 31s
-
(Locked)
Basic syntax of a contract5m 52s
-
(Locked)
Types in Solidity6m 31s
-
(Locked)
Units and global variables5m 37s
-
(Locked)
Other special variables2m 37s
-
(Locked)
Functions overview3m 40s
-
(Locked)
Operators in Solidity4m 46s
-
(Locked)
Conditionals in Solidity3m 55s
-
-
-
-