Skip to content

Instantly share code, notes, and snippets.

View joejordan's full-sized avatar

Joe Jordan joejordan

View GitHub Profile
@axic
axic / ecverify.sol
Last active May 13, 2024 12:07
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 24, 2024 22:18
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@dsample
dsample / README.md
Last active July 19, 2024 14:14
ASCII art diagrams

ASCI art characters for creating diagrams

Characters:

Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
@fiveoutofnine
fiveoutofnine / HeapSort.sol
Created March 16, 2022 04:00
Solidity implementation of max-heapsort
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract HeapSort {
function sort(uint256[] calldata _input) external pure returns (uint256[] memory) {
_buildMaxHeap(_input);
uint256 length = _input.length;
unchecked {
for (uint256 i = length - 1; i > 0; --i) {
# ▇ => ▇ + ▇
# Minimal runtime bytecode for a contract that mutates
# into two child contracts and then self-destructs
# 1st child contract receives the call value
# 2nd child contract recevies the remaining balance
# author: Saw-mon and Natalie
# constructor payload for the spawned contract
# ┏━━━━━━━━━━━━━━━━━━━ push1 RUNTIME_BYTECODE_LEN # L
@vicnaum
vicnaum / EVM_Regex_Decompiler.md
Created December 28, 2022 10:03
EVM Regex Decompiler
@0age
0age / SeaportNavigatorABI.json
Created June 21, 2023 14:23
ABIs for SeaportNavigator & SeaportValidator contracts
[
{
"inputs": [],
"name": "CannotDeriveProofForSingleTokenId",
"type": "error"
},
{
"inputs": [],
"name": "CannotDeriveRootForSingleTokenId",
"type": "error"
@coffeexcoin
coffeexcoin / Dockerfile
Created August 4, 2023 16:46
create2crunch dockerfile
FROM nvidia/opencl
SHELL ["/bin/bash", "-c"]
RUN apt update
RUN apt install -y build-essential ocl-icd-opencl-dev git curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
RUN git clone --depth 1 https://github.com/0age/create2crunch
WORKDIR /create2crunch
RUN source $HOME/.cargo/env && cargo build --release
#Keyless Create2
@samczsun
samczsun / README.md
Last active February 1, 2024 20:34
SEAL 911 Members

This document has been moved!