当我签订继承合同的合同时,我需要再使用短语插入一次?
contract A {
using SafeMath for uint256
}
contract B is A {
//using SafeMath for uint256
function mul () public {
uint256 test = 1;
test.mul(3);
}
}
如果没有合同B的使用短语,我就遇到了“ Mul”的“ Mul”,在合同UINT256中依赖于参数依赖的查找后。”
当我签订了继承其他具有“使用Safemath for Uint256”的合同时,我是否必须再使用短语插入?
contract A {
using SafeMath for uint256
}
contract B is A {
//using SafeMath for uint256
function mul () public {
uint256 test = 1;
test.mul(3);
}
}
Without contract B's using phrase i encountered "Member "mul" not found or not visible after argument-dependent lookup in contract uint256."
When i make contract that inherit other contract which has "using SafeMath for uint256", do i have to insert using phrase one more time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于编译器版本。
自0.7以来,您需要分别重新登录每个合同中的库。
来自 docs> docs :
但是,在0.6及以上的版本中,进口图书馆也可以在儿童合同中获得。
It depends on the compiler version.
Since 0.7, you need to reimport the library in each contract separately.
From the docs:
However, in 0.6 and older versions, the imported library is available in the child contracts as well.