Created
August 2, 2022 13:43
-
-
Save cryptofish7/a341ab7b5bef087ffb6da571d03a2f21 to your computer and use it in GitHub Desktop.
Simple script to verify airdrop
This file contains 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 | |
import pandas as pd | |
from web3 import Web3 | |
AVAX_NODE = "https://api.avax.network/ext/bc/C/rpc" | |
SMOL_CREEPS_ADDRESS = "0x2cd4dbcbfc005f8096c22579585fb91097d8d259" | |
provider = Web3(Web3.HTTPProvider(AVAX_NODE)) | |
with open("abi.json", "r") as f: | |
abi = json.load(f) | |
creeps_contract = provider.eth.contract( | |
address=Web3.toChecksumAddress(SMOL_CREEPS_ADDRESS), abi=abi | |
) | |
balanceOf = creeps_contract.functions.balanceOf | |
wl = pd.read_excel("smol_creeps_wl.xlsx") | |
for i, row in wl.iterrows(): | |
address = Web3.toChecksumAddress(row["Address"]) | |
expected_amount = row["Amount"] | |
actual_amount = balanceOf(address).call() | |
if actual_amount != expected_amount: | |
print( | |
"{} expected {} but received {}".format( | |
address, expected_amount, actual_amount | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment