Skip to content

Instantly share code, notes, and snippets.

@subhanshu-shukla
subhanshu-shukla / ballot.sol
Created June 23, 2019 06: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.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@subhanshu-shukla
subhanshu-shukla / Voting.sol
Created July 4, 2019 18:39
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.4.18+commit.9cf6e910.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract Voting
{
event AddedCandidate(uint candidateID);
address owner;
function Voting()
public
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" style="background: transparent; background-color: transparent; color-scheme: light dark;" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1147px" height="461px" viewBox="-0.5 -0.5 1147 461"><defs/><g><g data-cell-id="WIyWlLk6GJQsqaUBKTNV-0"><g data-cell-id="WIyWlLk6GJQsqaUBKTNV-1"><g data-cell-id="YISNLImBGdde0iplB1gn-108"><g><rect x="870" y="17" width="251" height="282" fill="#ebd4bb" stroke="#000000" pointer-events="all" style="fill: light-dark(rgb(235, 212, 187), rgb(70, 50, 29)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/></g></g><g data-cell-id="YISNLImBGdde0iplB1gn-106"><g><rect x="33" y="20" width="544" height="273" fill="#dedede" stroke="#000000" pointer-events="all" style="fill: light-dark(rgb(222, 222, 222), rgb(46, 46, 46)); stroke: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));"/></g></g><g data