Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Documentation and updated to current status #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion tutorial-01/myfirstcontract.sol
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
pragma solidity ^0.5.0;
//SPDX-License-Identifier: Unlicense
// Providing the Licence type to the compiler which is added to the top as a comment

//Specifing the version of compiler used to compile the contract
pragma solidity ^0.8.0;

//contract is the keyword like class to create a new Contract
contract MyFirstContract {

//Visibility is set to private so that variables are only accessible inside the contract
string private name;
uint private age;

/**
@dev To set the name to the name provided by the user
@param newName To get the name from the user to store it in the Blockchain
memory is a keyword used to temporarily store data in the Blockchain
*/
function setName(string memory newName) public {
name = newName;
}

/**
@dev To get the value of name from the Blockchain as the variable are set private
memory is a keyword used to temporarily store data in the Blockchain
*/
function getName() public view returns (string memory) {
return name;
}

/**
@dev To set the age to the name provided by the user
@param newName To get the age from the user to store it in the Blockchain
*/
function setAge(uint newAge) public {
age = newAge;
}

/**
@dev To get the value of age from the Blockchain as the variable are set private
*/
function getAge() public view returns (uint) {
return age;
}
Expand Down