2020-03-09 21:14:07 +00:00
|
|
|
contract Base {
|
|
|
|
uint256 dataBase;
|
|
|
|
|
|
|
|
function getViaBase() public returns (uint256 i) {
|
|
|
|
return dataBase;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
contract Derived is Base {
|
|
|
|
uint256 dataDerived;
|
|
|
|
|
|
|
|
function setData(uint256 base, uint256 derived) public returns (bool r) {
|
|
|
|
dataBase = base;
|
|
|
|
dataDerived = derived;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getViaDerived() public returns (uint256 base, uint256 derived) {
|
|
|
|
base = dataBase;
|
|
|
|
derived = dataDerived;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ====
|
2020-11-21 13:54:16 +00:00
|
|
|
// compileToEwasm: also
|
2021-03-12 23:02:36 +00:00
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// setData(uint256,uint256): 1, 2 -> true
|
|
|
|
// getViaBase() -> 1
|
|
|
|
// getViaDerived() -> 1, 2
|