This file contains hidden or 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
contract Example{ | |
function test() public { | |
//6e91ec6b618bb462a4a6ee5aa2cb0e9cf30f7a052bb467b0ba58b8748c00d2e5 | |
keccak256(abi.encodePacked("aaaab")); | |
//b1f078126895a1424524de5321b339ab00408010b7cf0e6ed451514981e58aa9 | |
keccak256(abi.encodePacked("aaaac")); | |
} |
This file contains hidden or 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
contract Example{ | |
string name = "sepehr"; | |
function _multiply(uint a, uint b) private pure returns (uint) { | |
return a * b; | |
} | |
} |
This file contains hidden or 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
contract Example{ | |
string x = "hello"; | |
function sayHello() public view returns (string memory) { | |
return x; | |
} | |
} |
This file contains hidden or 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
contract Example{ | |
string x = "hello"; | |
function sayHello() public returns (string memory) { | |
return x; | |
} | |
} |
This file contains hidden or 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
contract Example{ | |
uint[] numbers; | |
function _addToArray(uint _number) private { | |
numbers.push(_number); | |
} | |
} |
This file contains hidden or 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
contract Example{ | |
struct Person { | |
uint age; | |
string name; | |
} | |
Person[] public people; | |
function createNewPersonAndAddToArray() public { |
This file contains hidden or 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
contract Example{ | |
eatHotDogs("sepehr", 100); | |
} |
This file contains hidden or 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
contract Example{ | |
function eatHotDogs(string memory _name, uint _amount) public { | |
} | |
} |
This file contains hidden or 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
contract Example{ | |
Person[] people; // dynamic Array, we can keep adding to it | |
} |
This file contains hidden or 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
contract Example{ | |
// Array with a fixed length of 2 elements: | |
uint[2] fixedArray; | |
// another fixed Array, can contain 5 strings: | |
string[5] stringArray; | |
// a dynamic Array - has no fixed size, can keep growing: | |
uint[] dynamicArray; | |