This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verify Github on Galaxy. gid:iFWAMPgeko9y9Yq5ysswYR |