2019-02-28 13:16:16 +00:00
|
|
|
contract C {
|
|
|
|
uint256 public stateDecimal = 0x20;
|
|
|
|
}
|
|
|
|
|
|
|
|
contract D {
|
|
|
|
bool public stateBool = true;
|
|
|
|
uint256 public stateDecimal = 42;
|
|
|
|
bytes32 public stateBytes = "\x42\x00\xef";
|
|
|
|
|
|
|
|
function internalStateDecimal() public returns (uint256) {
|
|
|
|
return (new C()).stateDecimal();
|
|
|
|
}
|
|
|
|
|
|
|
|
function update(bool _bool, uint256 _decimal, bytes32 _bytes) public returns (bool, uint256, bytes32) {
|
|
|
|
stateBool = _bool;
|
|
|
|
stateDecimal = _decimal;
|
|
|
|
stateBytes = _bytes;
|
|
|
|
return (stateBool, stateDecimal, stateBytes);
|
|
|
|
}
|
|
|
|
}
|
2020-11-02 19:53:42 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2019-02-28 13:16:16 +00:00
|
|
|
// ----
|
|
|
|
// stateBool() -> true
|
|
|
|
// stateBool() -> right(true)
|
|
|
|
// stateDecimal() -> 42
|
|
|
|
// stateDecimal() -> right(42)
|
|
|
|
// stateBytes() -> left(0x4200ef)
|
|
|
|
// internalStateDecimal() -> 0x20
|
2021-05-18 13:39:08 +00:00
|
|
|
// gas legacy: 101807
|
2019-02-28 13:16:16 +00:00
|
|
|
// update(bool,uint256,bytes32): false, -23, left(0x2300ef) -> false, -23, left(0x2300ef)
|