Author: Chris Lattner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; align business expenses with IRS Schedule C categories: | |
; Advertising | |
; Business Travel | |
; Commissions | |
; Communication | |
; Contract Labor | |
; Insurance Payments | |
; Interest Payments | |
; Legal and Professional Fees | |
; Meals and Entertainment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) | |
extension Data { | |
init(referencing data: DispatchData) { | |
self = (data as AnyObject) as! Data | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/openjdk:8-jdk | |
steps: | |
- checkout | |
- setup_remote_docker | |
- run: | |
name: install aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3') | |
const Tx = require('ethereumjs-tx').Transaction | |
// connect to Infura node | |
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY')) | |
// the address that will send the test transaction | |
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd' | |
const privateKey = new Buffer('PRIVATE_KEY', 'hex') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Shoutouts: | |
* | |
* Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/ | |
* Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/ | |
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here: https://gist.github.com/izqui/7f904443e6d19c1ab52ec7f5ad46b3a8 | |
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe: https://github.com/gnosis/gnosis-safe-contracts | |
* | |
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls. | |
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory: https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/ProxyFactory.sol |
Suppose we wish to model a UTXO system on the EVM. We need to represent UTXO tokens such that all value is preserved when tokens are spent. Note: For this example, we are not concerned about the security of the system and are satisfied with giving authorities the power to create tokens (e.g. as in a plasma system).
Consider the following object:
{
owner: <address>,
value: <uint>,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.10; | |
// Based on Alex Miller's design, with minor revisions to appease the compiler, and incorporate Christian Lundkvist's | |
// input about hash collisions. | |
contract Bitcoin { | |
struct UTXO { | |
address owner; | |
uint value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vi: set ft=dockerfile : | |
# example usage | |
# docker build -t cosmos . | |
# docker run -d -v cosmos-data:/opt/cosmos --rm -ti --name cosmos-1 cosmos | |
# docker exec -it cosmos-1 sh | |
# /go/bin/basecli --home $BASECOIN_HOME keys add default | |
# /go/bin/gaiad --home $GAIAD_HOME show_validator | |
FROM golang:1-alpine | |
RUN apk add --no-cache git make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.22; | |
// ECE 398 SC - Smart Contracts and Blockchain Security | |
// http://soc1024.ece.illinois.edu/teaching/ece398sc/spring2018/ | |
// Simpest possible duplex-micropayment channel | |
// - Funded with an up front amount at initialization | |
// - The contract creator is called "alice". The other party, "bob", is passed | |
// as an argument to the Constructor | |
// - There is no fixed deadline, but instead any party can initiate a dispute, | |
// which lasts for a fixed time |