Help us understand the problem. What is going on with this article?

Solidityで親要素のコンストラクタに引数を渡す方法

Solidityでは継承元のコンストラクタに引数を渡す方法が2つあります。

contract Parent {
    uint x;
    constructor(uint _x) public { x = _x; }
}

// 直接継承元に引数を渡す方法
contract Chaild1 is Parent(7) {
    constructor() public {}
}

// modifierで親要素のコンストラクタに引数を渡す方法
contract Chaild2 is Parent {
    constructor(uint _y) Parent(_y) public {}
}

引数を渡さなければそのまま抽象化となります。

詳しくはSolidity公式ドキュメント最新版(v0.5.4)を参照してください。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away