mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nprimo
4fa5c876a7
|
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago |
README.md
Named Festival
In this exercise you will create your first smart contract! For a beginner friendly environment, I recommend remix. It is an online IDE that provides many useful functionalities.
If you want a more complete local dev environment, you can have a look at hardhat.
Instructions
- First, you need to specify the licence and the solidity version you will be using. If you have not thought about it, you can use UNLICENSED.
// SPDX-License-Identifier: UNLICENSED
- Pragma specifies the version of solidity you will use. The tests are designed to work with version 0.8.4 of solidity.
pragma solidity ^0.8.4;
- Then create a Smart Contract named
NamedFestival
. - NB: The file name of the contract must be in kebab-case
named-festival.sol
, while contracts names are in PascalCase by convention - Create a public function
setName()
that takes a string as parameter and sets the name of the festival - Finally a function
getName()
takes no parameters and retrieves the name
Expected Functions
contract NamedFestival {
//...
}
function setName(string memory input) public {
//...
}
function getName() public view returns (string memory) {
//...
}