Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active May 9, 2021 19:12
Show Gist options
  • Save percybolmer/d9ca7fb02ac7e985cc44dd79b5768a92 to your computer and use it in GitHub Desktop.
Save percybolmer/d9ca7fb02ac7e985cc44dd79b5768a92 to your computer and use it in GitHub Desktop.
A gist showing how we can create a struct in solidity
/**
* @notice
* A stake struct is used to represent the way we store stakes,
* A Stake will contain the users address, the amount staked and two time stamps,
* Since which is when the stake was made
* Until is the end date of the stake
*/
struct Stake{
address user;
uint256 amount;
uint256 since;
uint256 until;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment