Skip to content

Instantly share code, notes, and snippets.

@prtk418
Created April 25, 2022 02:52
Show Gist options
  • Save prtk418/6d8fee8c6794278cb13c158177655cb3 to your computer and use it in GitHub Desktop.
Save prtk418/6d8fee8c6794278cb13c158177655cb3 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=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
/// @notice Hello World contract
contract HelloWorld {
/// @notice state variable to store the number
uint256 intToStore;
/**
* @notice Stores specified number in contract
* @param _number number which needs to be set in contract intToStore variable
*/
function storeNumber(uint256 _number) external {
intToStore = _number;
}
/**
* @notice Retrieves the number which is stored in contract and can be updated using storeNumber function
*/
function retrieveNumber() external view returns (uint256) {
return intToStore;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment