Last active
January 15, 2022 17:56
-
-
Save raj-pranav/a4642949b9f6df7f08d931f4f77a727b to your computer and use it in GitHub Desktop.
Learn solidity from the basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT-License | |
pragma solidity ^0.8.0; | |
contract first_sample { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT-License | |
pragma solidity >0.5.0 <=0.9.0; | |
contract Organization { | |
uint16 num_of_emp = 100; // This will be stored on blockchain and costs money | |
uint public total_Turnover = 100000000; //accessible from outside | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tutorial Link on State Variable: https://github.com/raj-pranav/learn-solidity/blob/main/Tutorials/3-state_variable_solidity.md | |
// SPDX-License-Identifier: MIT-License | |
pragma solidity >0.5.0 <=0.9.0; | |
contract xyz { | |
uint16 public myHeight = 184; // state variable 'myHeight' is declared and assigned a value | |
string public myName; // state variable 'myName' is declared and will be assigned value using constructor | |
uint public myPay; // state variable 'myPay' is declared and value will be assigned using function setPay | |
constructor() { | |
myName = 'ETH'; | |
} | |
function setPay() public { | |
myPay = 420000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment