Skip to content

Instantly share code, notes, and snippets.

@halaprix
halaprix / tuple_decode.py
Created November 7, 2024 10:19
simple tuple decoding
from eth_abi import decode
from eth_utils import to_hex, to_checksum_address
def decode_swap_data(hex_data):
# Remove '0x' if present
hex_data = hex_data.replace('0x', '')
# First, decode the initial offset
data_bytes = bytes.fromhex(hex_data)
(initial_offset,) = decode(['uint256'], data_bytes[:32])
@halaprix
halaprix / claim_spark.py
Created October 16, 2024 10:15
Claim rewards calldata - spark
import json
from web3 import Web3
from eth_abi import encode
import csv
# Configure these variables
RPC_URL = "" # Replace with your Infura project ID or other RPC URL
CONTRACT_ADDRESS = "0x4370D3b6C9588E02ce9D22e684387859c7Ff5b34" # Replace with the actual contract address
ASSET_ADDRESS = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" # Replace with the actual asset address
REWARD_ADDRESS = "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0" # Replace with the actual reward token address
@halaprix
halaprix / claim_ethena.py
Created October 16, 2024 10:13
sENA - claim multiple calldata generator
import requests
from eth_abi import encode
from eth_utils import to_checksum_address
import time
import json
import os
def ensure_folder(folder_name):
if not os.path.exists(folder_name):
os.makedirs(folder_name)
@halaprix
halaprix / Verify Github on Galaxy. gid:iFWAMPgeko9y9Yq5ysswYR
Created April 29, 2022 17:35
Verify Github on Galaxy. gid:iFWAMPgeko9y9Yq5ysswYR
Verify Github on Galaxy. gid:iFWAMPgeko9y9Yq5ysswYR