Skip to content

Instantly share code, notes, and snippets.

@cryptofish7
Created August 2, 2022 13:43
Show Gist options
  • Save cryptofish7/a341ab7b5bef087ffb6da571d03a2f21 to your computer and use it in GitHub Desktop.
Save cryptofish7/a341ab7b5bef087ffb6da571d03a2f21 to your computer and use it in GitHub Desktop.
Simple script to verify airdrop
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