Skip to content

Instantly share code, notes, and snippets.

from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
from ethereum import tester as t
from rlp.utils import encode_hex
from ethereum.utils import sha3
from ethereum.tester import keys
# CONFIG
BALANCE = 10000000000000000000000
GAS_PRICE = 10000000000000
GAS_LIMIT = 500000000
@Georgi87
Georgi87 / StateChannel.sol
Last active February 2, 2018 20:49
Generalized settlement for state channels using proxy contracts.
pragma solidity ^0.4.0;
contract Token {
function transfer(address to, uint256 value) returns (bool);
function transferFrom(address from, address to, uint256 value) returns (bool);
}
/// @title State Channel contract - Allows multiple parties to settle off-chain transactions.
/// @author Stefan George - <[email protected]>
contract StateChannelProxy {
@Georgi87
Georgi87 / MultiSigWallet.sol
Last active September 9, 2016 14:58
Multisignature wallet - Allows multiple parties to agree on transactions before execution.
pragma solidity ^0.4.0;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <[email protected]>
contract MultiSigWallet {
event Confirmation(address sender, bytes32 transactionHash);
event Revocation(address sender, bytes32 transactionHash);
event Submission(address sender, bytes32 transactionHash);
event Execution(address sender, bytes32 transactionHash);
pragma solidity ^0.4.0;
import "Tokens/AbstractToken.sol";
/// @title Standard token contract - Standard token interface implementation.
contract StandardToken is Token {
/*
* Data structures
*/
pragma solidity ^0.4.0;
/// @title Standard token contract - Standard token interface implementation.
contract StandardToken {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => uint256) balances;
pragma solidity 0.4.9;
contract Leaderboard {
mapping (uint => User) leaderboard;
struct User {
address user;
uint score;
}
pragma solidity 0.4.4;
import "StandardToken.sol";
contract ReceiptToken is StandardToken {
address owner;
modifier isOwner() {
if (msg.sender != owner)
pragma solidity ^0.4.10;
/// @title Payroll contract - Allows employees to receive salary payments and to cash checks.
/// @author Stefan George - <[email protected]>
contract Payroll {
event EmployeeAddition(address indexed employee, uint startDate, uint endDate, uint yearlyUSDSalary);
event EmployeeDeletion(address indexed employee);
event PayoutSalary(address indexed employee, uint amount, uint ethPrice);
pragma solidity 0.4.10;
contract Token {
function transfer(address to, uint256 value) returns (bool success);
function balanceOf(address owner) constant returns (uint256 balance);
}
contract IOU {
contract Token {
function transfer(address to, uint value) public returns (bool);
function transferFrom(address from, address to, uint value) public returns (bool);
}
contract DutchExchange {
event SellOrderSubmission(address sender, uint amount, Token sellToken, Token buyToken, uint startDate);
event SellOrderCancellation(address sender, uint amount, Token sellToken, Token buyToken, uint startDate);