2

结构体

 3 years ago
source link: https://learnblockchain.cn/question/1739
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

5 结构体嵌套查询问题

struct Join {
        uint256 num;
}
struct User{
        uint256 amount;
	Join [] join 
}
mapping(address => User) public users;

之前部署的合约,Join 中的 num 没写函数去查询,外部就没法获取这个值了,users 是公共变量,自带的查询方法只能获取 amount,不能查到嵌套的结构体数据,想问一下还有别的办法获取到 num 值吗?谢谢了

最佳答案 7小时前

Tiny熊 - 布道者
擅长:智能合约,以太坊 | 采纳率 47% | 回答于 7小时前

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK