Skip to content

Instantly share code, notes, and snippets.

View sambacha's full-sized avatar
:atom:

sam bacha sambacha

:atom:
View GitHub Profile
// SPDX-License-Identifier: UPL-1.0
pragma solidity ^0.8.20;
interface MyInterface {
/// Errors related to the state of an auction.
/// @param slot The unique identifier for the auction.
error AuctionAlreadyOpen(uint256 slot);
/// Errors related to the state of an auction.
/// @param slot The unique identifier for the auction.
@sambacha
sambacha / relay-slot-check.py
Created June 13, 2024 08:38
Query MEV Relay Endpoints for Available Slots then Reduce to see which slots are not available
#!/usr/bin/env python3
"""
Query MEV Relay Endpoints for Available Slots
Reduce to see which slots are not available
Saves output in format:
[relay, [slot1,...,slotn+1]]
titanrelay.xyz,"9278499,9278503,9278504,9278505,9278506,9278510,9278523,9278529,9278533,9278542,9278543,9278556"
@sambacha
sambacha / BigNumberAssertions.sol
Created May 31, 2024 16:08
Solidity BigNumber Assertions
/// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.8.9;
import "forge-std/Test.sol";
/// @title BigNumberAssertions
contract BigNumberAssertions is Test {
uint256 constant fullScale = 10**18;

Access control matrix for account sharing system

Endpoint user1 user2 user3 user4
/balance GET GET GET GET
/transfers GET GET GET
POST POST
/settings PATCH
@top Program { Statement* }
@tokens {
pragma { "pragma" }
import { "import" }
contract { "contract" }
interface { "interface" }
library { "library" }
function { "function" }
modifier { "modifier" }
@sambacha
sambacha / generate_go_bindings_foundry.sh
Created May 9, 2024 03:08
Generate Golang bindings for Solidity using Foundry - based off of OP script
#!/usr/bin/env bash
set -eu
# Generate Go bindings for contract
#
# CONTRACTS_PATH="./src"
if [ "$#" -ne 2 ]; then
@sambacha
sambacha / init-systctl.sh
Created April 8, 2024 04:12
Tuning Ethereum Clients Base System
#!/usr/bin/env bash
echo "Warning This Script is Incomplete..."
# SYSV Shared Memory
sudo sysctl kern.sysv.shmmax=8388608
sleep 1
sudo sysctl kern.sysv.shmseg=48
sleep 1

ethereum_spec_tools.evm_tools package

Subpackages

:maxdepth: 4

ethereum_spec_tools.evm_tools.b11r
ethereum_spec_tools.evm_tools.t8n

Anvil RPC Methods

anvil_impersonateAccount
anvil_stopImpersonatingAccount
anvil_autoImpersonateAccount
anvil_getAutomine
anvil_mine
anvil_dropTransaction
anvil_reset
{
"DSRV": {
"name": "DSRV",
"website": "https://www.dsrvlabs.com"
},
"Kukis Global": {
"name": "Kukis Global",
"website": "https://www.kukis-global.com"
},
"Nethermind": {