Skip to content

Instantly share code, notes, and snippets.

@connorphill
connorphill / blocksoftomorrow_visibility-example
Last active October 21, 2021 11:26
Example of using visibility in a solidity smart contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title VisibiltyExample
/// @author Connor Phillips (blockchain@connorphillips.com)
/// @notice Purpose of the contract is to show how visibility works
/// @dev All function calls are currently implemented without side effects
contract VisibiltyExample {
string greeting = "Hello World!"; // The default visibility for state variables are internal
@connorphill
connorphill / 1_HotelGreeting.sol
Last active October 26, 2021 17:36
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: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title HotelGreeting
/// @author Connor Phillips (blockchain@connorphillips.com)
/// @notice Purpose of the contract is to leave a greeting to a guest who has arrived
/// @dev All function calls are currently implemented without side effects
contract HotelGreeting {