Skip to content

Instantly share code, notes, and snippets.

@schesnowitz
Created February 13, 2023 19:07
Show Gist options
  • Save schesnowitz/91830c1c7bbcf79b0d74fef45cb4f3ee to your computer and use it in GitHub Desktop.
Save schesnowitz/91830c1c7bbcf79b0d74fef45cb4f3ee to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
contract Basic {
// General vars
uint public someNonSigned = 66;
int private txtAmt = 55000;
string internal coinName = "STEVE COIN";
bool isThisValid = true;
// private can only be called FROM the contract
// internal can only be called from BY the contract AND other contracts within it
// external can only be called from a function
// General vars
uint public blockTime = block.timestamp;
address public sender = msg.sender;
// Arrays
string[] public tokenNames = ["Chainlink", "Ehereum", "Bitcoin", "Dodege"];
uint[5] public levels = [1,2,3,4,5];
// DateTime
uint public timeSeconds = 1 seconds;
uint public timeMinutes = 1 minutes;
uint public timeHours = 1 hours;
uint public timeDays = 1 days;
uint public timeWeeks = 1 weeks;
struct User {
string name;
bool hasTraded;
int yearsTraded;
address userAddress;
}
// store the struct in Array
User[] public user;
// Mappings
mapping(string => string) accountNameMap;
mapping(address => mapping(string => User)) public someUserInfo;
enum trustLevel{HIGH, MEDIUM, LOW}
trustLevel rank;
trustLevel public defaultTrustLevel = trustLevel.MEDIUM;
/// @notice Explain to an end user what this does
/// @dev Explain to a developer any extra details
/// @return Documents the return variables of a contract’s function state variable
/// @inheritdoc Copies all missing tags from the base function (must be followed by the contract name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment