Skip to content

Instantly share code, notes, and snippets.

@ryestew
ryestew / contracts...2_Owner.sol
Created January 26, 2022 05:45
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 Owner
* @dev Set & change owner
*/
contract Owner {
@ryestew
ryestew / contracts...1_StorageandotherhtinkgstogetthingbutnothotherreallyOKOKsothere.sol
Created November 10, 2021 13:13
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 Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
@ryestew
ryestew / contracts...3_Ballot.sol
Created October 4, 2021 19:57
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 Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
@ryestew
ryestew / contracts...3_Ballot_for_dumbies.sol
Created September 27, 2021 21:01
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;
// naming the contract
contract BallotString {
// We start with the "state" variables (the variable that are saved and show the state of the contract:
// The Voter STRUCT is a template containing what should be collected about a Voter - basically the Voter profile.
struct Voter {
// It has to be a STRUCT because the Voter has many "qualities" attached to it:
uint weight;
@ryestew
ryestew / contracts...3_Ballot_for_dumbies.sol
Created September 17, 2021 18:21
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;
// naming the contract
contract BallotString {
// We start with the state variables:
// The Voter STRUCT is a template for what should be collected about a Voter - basically the Voter profile.
struct Voter {
// It has to be a STRUCT because the Voter has many "qualities" attached to it:
uint weight;
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
@ryestew
ryestew / contracts...2_Owner.sol
Created July 28, 2021 16:17
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.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
@ryestew
ryestew / contracts...1_Storage.sol
Created June 2, 2021 02:28
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.1+commit.df193b15.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
@ryestew
ryestew / contracts...2_Owner.sol
Created June 2, 2021 02:28
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.1+commit.df193b15.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.8.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {