solidity/test/libsolidity/semanticTests/intheritance/access_base_storage.sol
2020-03-19 14:42:25 +01:00

31 lines
616 B
Solidity

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;
}
}
// ====
// compileViaYul: also
// ----
// setData(uint256,uint256): 1, 2 -> true
// getViaBase() -> 1
// getViaDerived() -> 1, 2