Starting with the absolute basics:
A contract is the fundamental building block of Ethereum applications — all variables and functions belong to a contract, and this will be the starting point of all your projects.
Vyper contracts are contained within files. Each file contains exactly one contract.
Vyper supports a version pragma to ensure that a contract is only compiled by the intended compiler version, or range of versions. Version strings use NPM style syntax.
For the scope of this tutorial, we'll want to compile our smart contracts with any compiler version in the range of 0.2.0
(inclusive) to 0.3.0
(exclusive). It looks like this:
# @version >=0.2.0 <0.3.0
-
In the box to the right, let's create a contract that can be compiled by any compiler version in the range of
0.2.4
(inclusive) to0.3.0
(exclusive). -
When you're finished, you can switch from
🛠 Your code
tab to the✅ Solution
tab to check if your answer matches with the solution (Tabs are on the bottom right of the screen). -
Check the difference between
🛠 Your code
and✅ Solution
in the𝌡 Difference
tab. -
If you have any questions just click
Open Chat
and ask in the chat 😊
Congratulations 🎉
You just completed Chapter 1. Tweet about it to share your amazing feat!