我无法在 User 结构中获取 weeklyBusiness 数组。因为合同已经部署,有没有办法我可以更改 ABI 以获取用户结构的所有组件,包括使用 userInfo 函数的数组。
struct WeeklyBusiness {
uint256 amount;
uint256 time;
}
struct User {
uint256 level;
uint256 start;
WeeklyBusiness[] weeklyBusiness;
uint256[3] registered;
}
mapping(address => User) public userInfo;
生成的 ABI:
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "userInfo",
"outputs": [
{
"internalType": "uint256",
"name": "level",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "start",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
我尝试将其添加到生成的 ABI 的输出中,但没有成功:
{
"internalType": "tuple[]",
"name": "weeklyBusiness",
"type": "tuple[]"
}