1

override 能指定哪个呢?

 3 years ago
source link: https://learnblockchain.cn/question/1877
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.
override 能指定哪个呢?

override 能指定哪个呢?

这种情况下,应该怎么写?

Tiny熊 - 布道者 4小时前

  擅长:智能合约,以太坊

多种继承的 override , 像这样:


pragma solidity >=0.5.0 <0.7.0;

contract Base1 {
    function foo() virtual public {}
}

contract Base2 {
    function foo() virtual public {}
}

contract Inherited is Base1, Base2 {
    // Derives from multiple bases defining foo(), so we must explicitly
    // override it
    function foo() public override(Base1, Base2) {}
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK