pragma solidity ^0.4.22; contract TryNewFeatureContract { function TryNewFeatureContract() public { // for ~0.4.21 // constructor() public { // constructorは function なしのconstructorという名前で定義するようになった。 } function constructor() public pure returns(string) { // function 識別子をつけた場合はただの関数なので注意。 return string(normalFuctionMessage()); } function normalFuctionMessage() internal pure returns(bytes) { bytes memory message = "This is normal 0.4.21.."; return message; } function oneIsError(uint _num) returns(uint, string) { require(_num != 1, "hogehoge"); } }
0.4.22