/** contract is container where we write our code.
Each contract have it's own address.
if we have contract address and abi we can iteract with it.
**/
contract MyContract {
string public name = "Shirshak";
//name is state variable of type string which live in blockchain.
/// @notice This function changes the value of the name variable
// _newName we use _ before to tell that it is parameter
// string,struct and mapping are values that need to use memory
// and after sometime it will remove from that place
function updateName(string memory _newName) public {
name = _newName;
}
}
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.7.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}
contract ContractName {
}