坚固函数中的卷曲支架
我想知道在这种情况下卷曲括号是什么意思?
uint64 configCount = s_configCount;
{
s_hotVars.latestConfigDigest = configDigestFromConfigData(
address(this),
configCount,
_signers,
_transmitters,
_threshold,
_encodedConfigVersion,
_encoded
);
s_hotVars.latestEpochAndRound = 0;
}```
他们为什么使用{}?为什么他们没有这样写代码:
uint64 configCount = s_configCount;
s_hotVars.latestConfigDigest = configDigestFromConfigData(address(this),configCount,_signers,_transmitters,_threshold,_encodedConfigVersion,_encoded);
s_hotVars.latestEpochAndRound = 0;
I would like to know what curly brackets mean in that case ?
uint64 configCount = s_configCount;
{
s_hotVars.latestConfigDigest = configDigestFromConfigData(
address(this),
configCount,
_signers,
_transmitters,
_threshold,
_encodedConfigVersion,
_encoded
);
s_hotVars.latestEpochAndRound = 0;
}```
Why did they use {} ? why they didn't wrote the code like this :
uint64 configCount = s_configCount;
s_hotVars.latestConfigDigest = configDigestFromConfigData(address(this),configCount,_signers,_transmitters,_threshold,_encodedConfigVersion,_encoded);
s_hotVars.latestEpochAndRound = 0;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
卷曲牙套适用于。
他们还分配了一个新的堆栈框架。因为小堆栈对EVM中的开发人员来说是一个痛苦。需要使用深度调用结构来范围范围,以避免堆叠太深的错误。
Curly braces are for the scoping rules.
They also allocate a new stack frame. Because the small stack is a pain for developers in EVM. Scoping is needed with deep call structures to avoid stack too deep error.