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
pragma solidity 0.8.11; | |
contract Modifiers { | |
address public owner; | |
constructor() { | |
owner = msg.sender; | |
} |
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
pragma solidity 0.8.11; | |
contract ViewAndPure { | |
uint stateNumber = 1; | |
function addViewFunction(uint _number) external view returns(uint) { | |
return stateNumber + _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
pragma solidity 0.8.11; | |
contract CheckGasPrice{ | |
function gasPrice() external view returns (uint) { | |
return tx.gasprice; | |
} | |
uint public i = 0; | |
function forever() 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
pragma solidity 0.8.11; | |
contract EtherCheck { | |
uint public oneEther = 1 ether; | |
uint public oneWei = 1 wei; | |
function testOneEther() external pure returns (bool) { | |
return 1 ether == 1e18 wei; | |
} |
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
pragma solidity 0.8.11; | |
contract EtherCheck { | |
uint public oneEther = 1 ether; | |
uint public oneWei = 1 wei; | |
function testOneEther() external pure returns (bool) { | |
return 1 ether == 1e18 wei; | |
} |
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
pragma solidity 0.8.11; | |
contract TextStorage { | |
string public text; | |
function setText(string memory _text) external { | |
text = _text; | |
} | |
function getText() external view returns (string memory) { |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
*/ | |
contract Storage { |
NewerOlder