0% found this document useful (0 votes)
11 views1 page

Pratica - Hello - Sol

This Solidity contract named 'Hello' includes a string variable, several byte representations, and functions to get and set the string value. It also features a boolean, two unsigned integers, and a function to increment the uint8 variable. The contract constructor initializes the address of the contract deployer and includes a function to return the current block difficulty.

Uploaded by

Adrian BesTel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Pratica - Hello - Sol

This Solidity contract named 'Hello' includes a string variable, several byte representations, and functions to get and set the string value. It also features a boolean, two unsigned integers, and a function to increment the uint8 variable. The contract constructor initializes the address of the contract deployer and includes a function to return the current block difficulty.

Uploaded by

Adrian BesTel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// SPDX-License-Identifier: MIT

pragma solidity >= 0.7.0 < 0.9.0;

contract Hello{
string public myString = "Hello Blockchain";

bytes public myStringByte = "Hello Blockchain";

bytes public myUniStringByte = unicode"Hello Blockchain";

function getHelloBlockchain() public view returns (string memory){


return myString;
}
function setMyString(string memory newString) public {
myString = newString;
}
bool public myBool = true;

uint256 public myUint256 = 2**4;

uint8 public myUint8 = 254;

function incrementUint8() public {


unchecked{
myUint8++;
}

}
address myAdress;

constructor(){
myAdress = msg.sender;
}

function getDifficulty() public view returns (uint){


uint256 b = 33;
return block.difficulty;
}

}
//coment
/*

*/

You might also like