import csv,requests,json,time
from web3 import Web3
from eth_account import Account
from eth_account.messages import encode_defunct
def claim():
#判断是否claim过
try:
router = w3.eth.contract(contract, abi=abi)
claim1 = router.functions.minted(from_address).call()
print(f'是否claim过:{claim1}')
if claim1 is True:
return
except:
pass
#API获取参数
while True:
timestamp=int(time.time()*1000)
try:
res=requests.get(f'https://nft.scroll.io/p/{from_address}.json?timestamp={timestamp}',proxies=proxies)
if res.status_code==200:
try:
res1=res.json()
metadata=res1['metadata']
proof=res1['proof']
except:
print(from_address,':无资格领取')
return