0%

OKX X Zeta Readon Free Mint

又是一个获取身份卡NFT的项目,所以应该不会太复杂,准备看一下。

首先观察data数据,寻找规律。

1
0xe816fc8f00000000000000000000000000000000000000000000000017a85a02c428f002000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019313730343731313432363838373138343338364d595a4554410000000000000000000000000000000000000000000000000000000000000000000000000000416713250a993bc462f7c6fed2d8c7825bc57e5087e818af076f0e81329e74948a10591563259a3454b78fdd13d7a33d704ec8e3aa7a22b28e7943d6575ec9731a1b00000000000000000000000000000000000000000000000000000000000000
1
0xe816fc8f00000000000000000000000000000000000000000000000017a85a133ca69374000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019313730343731313439373632383136303838344d595a455441000000000000000000000000000000000000000000000000000000000000000000000000000041476528c08432da501c055bfe36a30fbcdebe961f2c1141d57031543b08f69985195994bbab090fd1da75195d03386cf11394ee4e4737f0991ff5e0e7aa090f4a1b00000000000000000000000000000000000000000000000000000000000000
1
0xe816fc8f00000000000000000000000000000000000000000000000017a85aba884a5eb2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019313730343731323231363135363732343931344d595a4554410000000000000000000000000000000000000000000000000000000000000000000000000000411e7b605df31c4e1ff97df7042697ae07f17980c6b1dd23487b6845105038c8bc727c8f185186b01b9a99409454bae723ed91353cda397ba96b25ffbe861d10d31b00000000000000000000000000000000000000000000000000000000000000
1
0xe816fc8f00000000000000000000000000000000000000000000000017a85bbce4b4cdd0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019313730343731333332353830383736363431364d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000004153125c64cda5be395ba607b80d8800f5ef9caced7fa92f5b2a2180856568ff2b3439a083ab373b2b53c818a64b1664612a07c7a455bbb05d0c3b4214731c66841b00000000000000000000000000000000000000000000000000000000000000
1
0xe816fc8f00000000000000000000000000000000000000000000000017a85bbce4b4cdd0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019313730343731333733373233343934363233324d595a4554410000000000000000000000000000000000000000000000000000000000000000000000000000414aaa6ff6fe3f8dc4eb417dae83ea1c5891d05530def4a28f08043099fd9fc8ae5cd528dd90e127cb7b945330131db3c638559d1fd25fa070e9dfcb5edcba448e1b00000000000000000000000000000000000000000000000000000000000000

这里的数据一直发生变化,我去跟踪网络的请求发现有一个post请求。

image-20240108205422100

POST:

该请求地址:https://readon-api.readon.me/v1/manta_pacific/check_invite_code

参数:{“code”: “MYZETA”}

响应结果:

1
2
3
4
5
6
7
8
9
10
{
"code": 0,
"data": {
"err_code": 0,
"err_message": "",
"token_id": "1704713737234946232",
"signature": "0x4aaa6ff6fe3f8dc4eb417dae83ea1c5891d05530def4a28f08043099fd9fc8ae5cd528dd90e127cb7b945330131db3c638559d1fd25fa070e9dfcb5edcba448e1b"
},
"message": "success"
}

将这两个参数带入上面的data中,发现还缺少最后一个变量。

token_id数据转化为16进制,signature直接替换掉对应位置即可。

让GPT写代码,帮我们发送请求,并且获得到对应的数据。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package zeta.tools;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class HTTPPostRequestExample {

public static void main(String[] args) {
try {
// 请求地址
String url = "https://readon-api.readon.me/v1/manta_pacific/check_invite_code";

// 创建URL对象
URL obj = new URL(url);

// 打开连接
HttpURLConnection con = (HttpURLConnection) obj.openConnection();

// 设置请求方法为POST
con.setRequestMethod("POST");

// 设置请求头部信息
con.setRequestProperty("Content-Type", "application/json");

// 设置需要发送的数据
String postData = "{\"code\": \"MYZETA\"}";

// 启用输出流
con.setDoOutput(true);

// 发送POST请求
OutputStream os = con.getOutputStream();
os.write(postData.getBytes());
os.flush();
os.close();

// 获取响应代码
int responseCode = con.getResponseCode();

// 读取响应内容
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();

while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();

// 判断请求是否成功
if (responseCode == HttpURLConnection.HTTP_OK) {
System.out.println("请求成功!");
// 从响应中提取 token_id 和 signature 的值
String jsonResponse = response.toString();
// 解析 JSON 获取 token_id 和 signature
// 这里可以使用 JSON 解析库如 JSON.simple 或者 Gson
// 以下是用 JSON.simple 解析的示例代码

JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(jsonResponse);
JSONObject dataObject = (JSONObject) jsonObject.get("data");
String tokenId = (String) dataObject.get("token_id");
String signature = (String) dataObject.get("signature");
// 打印到控制台
System.out.println("Token ID: " + tokenId);
System.out.println("Signature: " + signature);
} else {
System.out.println("请求失败!");
}
} catch (Exception e) {
System.out.println("发生异常:" + e.getMessage());
}
}
}

拼接data:

把上面的代码抽象成为一个方法。

然后我们开始拼接需要的data数据字符串。

其中有一个随机的字符串,他只需要随机即可(不能复制使用重复的内容)。

我们写一个随机的代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 获取一个随机10位的16进制字符串
public static String string0x16(){
// 生成一个随机数生成器
SecureRandom random = new SecureRandom();

// 生成一个 StringBuilder 来存储随机字符串
StringBuilder stringBuilder = new StringBuilder(10);

// 循环生成随机字符,直到达到10位长度
while (stringBuilder.length() < 10) {
// 生成一个随机的16进制字符
int randomValue = random.nextInt(16); // 生成0-15之间的随机数
char hexChar = (randomValue < 10) ? (char) ('0' + randomValue) : (char) ('a' + randomValue - 10);

// 将生成的随机字符追加到字符串中
stringBuilder.append(hexChar);
}
return stringBuilder.toString();

}

剩下的拼接就简单了。

我们把对应的数据填写好即可,我是直接写死在代码里面。

1
2
3
4
5
6
7
8
9
10
// 拼接字符串
String data1 = "0xe816fc8f00000000000000000000000000000000000000000000000017a85";
String data3 = "0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000064d595a45544100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019";
String data4 = ChineseToHex.chineseToHex(tokenId);
String data5 = "4d595a455441000000000000000000000000000000000000000000000000000000000000000000000000000041";
String data6 = signature.substring(2);
String data7 = "00000000000000000000000000000000000000000000000000000000000000";
// 生成随机字符串2
String data2 = HTTPPostRequestExample.string0x16();
return data1+data2+data3+data4+data5+data6+data7;

然后老样子,写一个EIP1559发送请求,将合约地址换成。

0xB028873223d6f9624368b4Bb488e0aBe6a2F3726

然后测试代码是否正常运行,如果可以,写上循环(批量获取钱包,批量执行)。

image-20240108205247058

测试成功。

结果:

又批量完成一个任务。

image-20240108210341510