2020-03-09 21:14:07 +00:00
|
|
|
contract Helper {
|
|
|
|
bytes3 name;
|
|
|
|
bool flag;
|
|
|
|
|
|
|
|
constructor(bytes3 x, bool f) public {
|
|
|
|
name = x;
|
|
|
|
flag = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getName() public returns (bytes3 ret) {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFlag() public returns (bool ret) {
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
contract Main {
|
|
|
|
Helper h;
|
|
|
|
|
|
|
|
constructor() public {
|
|
|
|
h = new Helper("abc", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFlag() public returns (bool ret) {
|
|
|
|
return h.getFlag();
|
|
|
|
}
|
|
|
|
|
|
|
|
function getName() public returns (bytes3 ret) {
|
|
|
|
return h.getName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-07 15:29:42 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// getFlag() -> true
|
|
|
|
// getName() -> "abc"
|