Skip to content

Instantly share code, notes, and snippets.

View 0xClandestine's full-sized avatar
🧙

clandestine.eth 0xClandestine

🧙
View GitHub Profile
@0xClandestine
0xClandestine / verifier.py
Created July 16, 2025 22:41
Block hash verification example
from web3 import Web3
import rlp
from eth_utils import keccak, to_bytes, to_hex
class BlockHeaderVerifier:
def __init__(self, rpc_url=""):
self.w3 = Web3(Web3.HTTPProvider(rpc_url))
def get_block_header_fields(self, block):
"""Extract and format block header fields for RLP encoding"""
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;
import "src/test/integration/users/User.t.sol";
import "src/test/integration/IntegrationChecks.t.sol";
contract Integration_StorageGaps is IntegrationCheckUtils {
function assertSlotEq(address target, uint256 slot, uint256 value) internal {
assertEq(uint256(vm.load(target, bytes32(slot))), value, "Slot value mismatch");
}
@0xClandestine
0xClandestine / LegacyToNameSpaceConversion.t.sol
Last active January 14, 2025 20:39
Legacy Storage (slots assigned by compiler) to Namespace storage (slots explicitly assigned by us).
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {Test, console} from "forge-std/Test.sol";
contract LegacyStorage {
uint256 public number;
function setNumber(uint256 newNumber) public {
number = newNumber;