Skip to content

Instantly share code, notes, and snippets.

@xrzhuang
xrzhuang / eco_btn.sol
Created April 1, 2020 16:46
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.26+commit.4563c3fc.js&optimize=false&gist=
pragma solidity ^0.4.18;
contract EcoBtn {
address private latestAddress;
uint256 private latestBlock = 0;
uint private amount = 0;
uint public FIXED_AMOUNT_WEI = 1000000000000000000;
constructor() public {
@xrzhuang
xrzhuang / ballot.sol
Created April 1, 2020 16:46
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.26+commit.4563c3fc.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 {