Skip to content

Instantly share code, notes, and snippets.

@PirosB3
PirosB3 / documentation.md
Last active August 7, 2020 23:23
0xDoc Documentation

0x Doc

Links

0x Doc was created to serve technically-savvy users such as market-makers, 0x API integrators, and RFQ providers that want to gain more insight from the on-chain magic that happens in 0x.

How does it work?

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PirosB3
PirosB3 / commitment.sol
Created May 18, 2018 05:43
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.0;
contract Commitment {
enum CommitmentState { OPEN, CLOSED }
mapping (address => bool) attendeesRegistered;
mapping (address => bool) attendeesRefunded;
uint totalDeposited;
uint totalGuests;
@PirosB3
PirosB3 / commitment.sol
Created May 18, 2018 05: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.0;
contract Commitment {
enum CommitmentState { OPEN, CLOSED }
mapping (address => bool) attendeesRegistered;
mapping (address => bool) attendeesRefunded;
uint totalDeposited;
uint totalGuests;
@PirosB3
PirosB3 / ballot.sol
Created May 18, 2018 05:15
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.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
from typing import Tuple, NamedTuple, List, Optional, Dict
class SpendResult(NamedTuple):
is_successful: bool
remaining_balance: int
class Bank(object):
{
"txid": "8608b1ee194cdacbd3b2d1728b4883afe11a76d4a60b3d8d1f36317ccc12d583",
"hash": "8608b1ee194cdacbd3b2d1728b4883afe11a76d4a60b3d8d1f36317ccc12d583",
"size": 224,
"vsize": 224,
"version": 2,
"locktime": 1488155936,
"vin": [
{
"txid": "a7681326607bbb94026fca9f21563b2c1418c22b8e39638f7910e338915ead46",
@PirosB3
PirosB3 / gist:ab7815fe5db951715aba7b0983a9ada7
Created September 27, 2016 07:54
My first raw transaction
{
"txid": "c15083d9593abad0e0ee35afa12ae7463497d34de0bc9a51e86b16634b5e9779",
"version": 1,
"locktime": 0,
"vin": [
{
"txid": "592928d43a21294fce7592edac21060aa47cc22d9c368c544cdcdb8ef178900c",
"vout": 0,
"scriptSig": {
"asm": "304402200e5ea2c9944770d5f823316565a7a1bd1131caeb203c827b47aa5d14596f80c502203e2fd2b99b39127d6f0cc5f30791048f890e2fe03cdc5d0c10e4b542b7ff8d0f01 036613cf1e844edde97f89468ce453bb609d3270a986ca9fbb6dd29d90773bf67e",
@PirosB3
PirosB3 / hexagon.md
Created June 22, 2016 00:23
hexagon.md

Hexagon: building a graph database on top of a key-value store

I've always been interested in how information is stored and retrieved. Inspired by a project of a friend (Levelgraph), I decided to research more about Hexastores and how they can be adapted to modern NoSQL databases such as LevelDB and Cassandra. Out of this fascination and curiosity I created Hexagon: a simple Python implementation of Hexastores backed by LevelDB.

In this talk I plan on giving a very simple and hands-on introduction to the subject, followed by a demonstration of how Python really allowed me to focus on the implementation thanks to its extremely intuitive syntax and features. I will show how generators, collections, and Test Driven Development allowed me to iterate fast and not get lost in (too many) bugs along the way.

The talk will start with an overview of what Hexagon is and the reason why I built it. The second step will consist in the explanation of the two main concepts behind Hexagon itself, namely LevelDB and the

my_request = flask.make_response('asd', 200, {'Authorization': 'bearer xxxxxxx'})