Skip to content

Instantly share code, notes, and snippets.

View 333cipher's full-sized avatar
💭
I may be slow to respond.

333cipher 333cipher

💭
I may be slow to respond.
View GitHub Profile
Verification for ETHSecurity Badge
My public address: 0xB1aF1BAc3ee4363455d7A0f5930c0D2723f3FEA6
Date: March 19, 2026
@333cipher
333cipher / decodingexample.py
Created May 4, 2025 18:02
Decoding ERC20 Approval Transactions Example
from eth_abi import decode
from eth_utils import to_checksum_address
def decode_erc20_approve(calldata: str, token_decimals: int = 18) -> dict:
"""
Decode ERC-20 approve calldata with human-readable output
Parameters:
- calldata: The hex calldata string
- token_decimals: Number of decimals for the token (default: 18)
@333cipher
333cipher / simulatingtransaction.py
Last active March 26, 2026 08:49
ERC-20 Approval Transaction Simulator with UI Spoofing Detection (Educational Example)
from web3 import Web3
import json
from eth_abi import decode
from eth_utils import to_checksum_address
# Connect to a local fork of mainnet
w3 = Web3(Web3.HTTPProvider('http://localhost:8545'))
# ERC-20 ABI (minimal for approval/allowance checks)
ERC20_ABI = [