Skip to content

Instantly share code, notes, and snippets.

@d0zingcat
Created June 19, 2024 06:53
Show Gist options
  • Save d0zingcat/c81e95fa5cdd43483d42a6cee8836a2e to your computer and use it in GitHub Desktop.
Save d0zingcat/c81e95fa5cdd43483d42a6cee8836a2e to your computer and use it in GitHub Desktop.
LayerZero Airdrop check
#!/bin/bash
# 读取地址文件
addresses_file="addresses.txt"
# 遍历每个地址
while IFS= read -r address; do
# 用占位符替换实际地址
url="https://www.layerzero.foundation/api/allocation/$address"
# 发起请求并获取响应
response=$(curl -s "$url" \
-H 'accept: */*' \
-H 'accept-language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7' \
-H 'dnt: 1' \
-H 'priority: u=1, i' \
-H 'referer: https://www.layerzero.foundation/eligibility' \
-H 'sec-ch-ua: "Chromium";v="125", "Not.A/Brand";v="24"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36')
# 提取 isEligible 字段
is_eligible=$(echo "$response" | jq -r '.isEligible')
zro_allocation=$(echo "$response" | jq -r '.zroAllocation.asString')
# 输出地址和 isEligible 结果
echo "Address: $address, isEligible: $is_eligible, allocated: $zro_allocation"
done < "$addresses_file"
@d0zingcat
Copy link
Author

创建一个 addresses.txt 在同一个目录下 一行贴入一个地址 然后执行 sh layerzero_check.sh 即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment