Skip to content

Instantly share code, notes, and snippets.

View FoobarProtocol's full-sized avatar
🤐
Stealth

Foobar Protocol FoobarProtocol

🤐
Stealth
View GitHub Profile
@FoobarProtocol
FoobarProtocol / echidna_example.sol
Last active September 14, 2024 02:05
This is the test echidna file that we created to go with the tutorial. There are errors in here on purpose. We're going to refine this smart contract and the finalized version will be submitted in an entirely separate contract
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.7.6;
import "./GnosisSafe.sol";
contract GnosisSafeTest is GnosisSafe {
constructor() {
// Initialize the Gnosis Safe with some owners and a threshold
address[] memory owners = new address[](3);
owners[0] = address(0x1);
@FoobarProtocol
FoobarProtocol / gnosis_safe_yul_1_1_1.yul
Created April 28, 2025 00:44
This is the equivalent Yul code of the Gnosis Safe logic contract for version 1.1.1
// Decompiled by library.dedaub.com
// 2025.04.18 18:07 UTC
object "contract" {
code { }
object "runtime" {
code {
function func_0x311e(_0, _1, _2) -> ret_val_0, ret_val_1 {
let _3 := mload(0x40)
mstore(_3, _0)
@FoobarProtocol
FoobarProtocol / two_eip712_duplicatehash.md
Last active May 6, 2025 13:02
Two EIP-712 Compliant JSON Files Evoke Same Signature

Getting straight to the point here, check out json file number one (formatted like a legitimate EIP-712 hash):

    {
      "types": {
        "EIP712Domain": [
          {
            "name": "name",
            "type": "string"
          },
@FoobarProtocol
FoobarProtocol / collide.py
Created June 2, 2025 18:41
This script allows us to find the first 4 bytes
#!/usr/bin/env python3
"""
safe_prefix_collision_miner.py
Parallel “4-byte-prefix” collision miner for Gnosis Safe’s buggy EIP-191 fallback,
with manual ABI-pack of `execTransaction(...)` calldata (no eth_abi dependency).
Usage:
python3 safe_prefix_collision_miner.py \
--catalogue safe_signature_catalogue.csv \
@FoobarProtocol
FoobarProtocol / sql_pull.py
Created July 29, 2025 04:52
Extract all functions and relevant information from all vaults owned by the same set of authorized signers as the ones from the Bybit Vault
#!/usr/bin/env python3
"""
Fetch Token Flow query results for a list of contract addresses.
* For each address:
1. POST the SQL (with address injected) -> receive sfqid
2. POST sfqid -> receive JSON results
3. Save to 0xXXXXXXXX.json (first 10 chars of address)
Requires: requests, tqdm