Skip to content

Instantly share code, notes, and snippets.

@mdip226
mdip226 / Democracy.sol
Created October 4, 2021 01:32
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=
pragma solidity '0.8.7';
contract Democracy {
// int tallyYes = 0;
uint256 results;
uint256 totalVotes;
constructor() {
totalVotes = 0;
results = 0;
@mdip226
mdip226 / README.txt
Created October 9, 2021 19:04
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=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@mdip226
mdip226 / Democracy.sol
Created October 16, 2021 23:16
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=
pragma solidity '0.8.7';
contract Democracy {
// int tallyYes = 0;
uint256 results;
uint256 totalVotes;
address owner;
modifier onlyOwner {
@mdip226
mdip226 / Democracy.sol
Created October 19, 2021 23:37
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=
pragma solidity '0.8.7';
contract Democracy {
// int tallyYes = 0;
uint results;
uint totalVotes;
address owner;
mapping(address=>uint) public votes;
@mdip226
mdip226 / Democracy.sol
Created October 20, 2021 00:31
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=
pragma solidity '0.8.7';
contract Democracy {
// int tallyYes = 0;
uint results;
uint totalVotes;
address owner;
mapping(address=>uint) public votes;
@mdip226
mdip226 / Democracy.sol
Created October 21, 2021 03: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=
pragma solidity '0.8.7';
contract Democracy {
// int tallyYes = 0;
uint results;
uint totalVotes;
address owner;
@mdip226
mdip226 / Democracy.sol
Created October 29, 2021 21:07
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-or-later
pragma solidity '0.8.7';
contract Democracy {
int256 results;
int256 totalVotes;
address payable owner;
mapping(address => int256) public votes;