Skip to content

Instantly share code, notes, and snippets.

View veox's full-sized avatar
💭
Being skeptical of status feature.

Noel Maersk veox

💭
Being skeptical of status feature.
View GitHub Profile
@jordanmack
jordanmack / user.js
Last active October 23, 2018 06:33
Peepeth Enhancer is a user script that adds several new features to Peepeth. To use this user script install you will need the Tampermonkey plugin. https://tampermonkey.net/
// ==UserScript==
// @name Peepeth Enhancer
// @namespace https://github.com/jordanmack/PeepethEnhancer
// @version 0.3.0
// @description Peepeth Enhancer is a collection of scripts that add several new features to Peepeth.
// @author Jordan Mack (jordanmack.info)
// @match https://peepeth.com/*
// @grant none
// ==/UserScript==
@jordanmack
jordanmack / gist:9373f9b922e906eeffb0cbff0cefe57e
Created August 25, 2018 04:51
Peepeth: Bookmarklet code to unhide all content without having to click.
javascript:(function()%7Bconst%20reveal%20%3D%20function()%7BjQuery(%22a.nsfwShow%22).click()%3BjQuery(%22a.politicsShow%22).click()%3B%7D%3Breveal()%3BsetInterval(reveal%2C%20500)%7D)()
@gsalgado
gsalgado / test_make_trie_root_and_nodes.py
Created August 23, 2018 05:40
profile make_trie_root_and_nodes()
import cProfile
import os
import pstats
import random
import rlp
from eth.db.trie import make_trie_root_and_nodes
from eth.vm.forks.frontier.transactions import FrontierTransaction
--- trim ---
https://peepeth.com/about
https://www.kickstarter.com/projects/1414168019/peepeth-social-network-for-a-better-world
Peepeth's data is open to anyone. The contract is stateless, except for recording unique usernames, so you have to query each block and parse the input data of each transaction according to the following ABI.
For more about stateless contracts, check out this great post.
https://medium.com/@childsmaidment/stateless-smart-contracts-21830b0cd1b6
@sorpaas
sorpaas / main.rs
Last active August 11, 2018 13:16
Brute Force Approach to EIP-1087/EIP-1283 Equivalence "Proof"
#[derive(Debug)]
struct Consumption {
used: usize,
refund: usize,
}
impl Consumption {
pub fn absolute(&self) -> isize {
self.used as isize - self.refund as isize
}
package main
import (
"context"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
)
var server = "http://localhost:8545"
var blockHash = "0xac8e95f7483f7131261bcc0a70873f8236c27444c940defc677f74f281220193"
@alex-miller-0
alex-miller-0 / eth-utxo.md
Last active February 3, 2024 15:20
UTXO tokens on Ethereum

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>,
layout title date
post
contract creation golf
2018-02-22 17:33

Fun little learning exercise, what's the shortest bytecode you can send that will publish a contract with non-zero bytecode? The response to getCode() should have some characters that aren’t either 0 or x.

To test it out:

@GNSPS
GNSPS / ProxyFactory.sol
Last active October 9, 2021 08:47
Improved `delegatecall` proxy contract factory (Solidity) [v0.0.5]
/***
* 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
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic