Merge pull request #9423 from ethereum/runtimeCodeSol2Yul

[Sol->Yul] Supporting .runtimeCode
This commit is contained in:
chriseth
2020-07-22 09:51:07 +02:00
committed by GitHub
3 changed files with 9 additions and 9 deletions
@@ -36,7 +36,8 @@ contract C {
return true;
}
}
// ====
// compileViaYul: also
// ----
// testRuntime() -> true
// testCreation() -> true
@@ -10,18 +10,18 @@ contract D {
}
}
contract C {
function test() public returns (uint256) {
D d = new D();
bytes32 hash;
assembly { hash := extcodehash(d) }
assert(hash == keccak256(type(D).runtimeCode));
return 42;
D d = new D();
bytes32 hash;
assembly { hash := extcodehash(d) }
assert(hash == keccak256(type(D).runtimeCode));
return 42;
}
}
// ====
// EVMVersion: >=constantinople
// compileViaYul: also
// ----
// test() -> 42