Created
February 3, 2023 10:12
-
-
Save ArslanKathia/e65b24801d5f6ef84e055505da355eb4 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
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: MIT | |
pragma solidity ^0.8; | |
contract Immutable{ | |
//immutable state variable can be set inline - constructor | |
address public immutable owner; | |
//constant defined only inline | |
address public constant owner2 = address(1); | |
//simple state variable defined. | |
address public owner3 = address(2); | |
constructor(address _owner){ | |
owner = _owner; | |
} | |
function IO() public view returns(address){ | |
return owner; | |
} | |
function CO() public pure returns(address){ | |
return owner2; | |
} | |
function PO() public view returns(address){ | |
return owner3; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment