Implement .creationCode for Sol->Yul.

This commit is contained in:
Daniel Kirchner
2020-05-11 18:51:51 +02:00
parent 3fbde6e782
commit c2f5a66a79
4 changed files with 44 additions and 1 deletions
@@ -29,6 +29,7 @@ contract C {
}
// ====
// EVMVersion: >homestead
// compileViaYul: also
// ----
// f(uint256), 2000 ether: 0 -> true
// f(uint256), 2000 ether: 100 -> false
@@ -22,5 +22,7 @@ contract C {
}
}
// ====
// compileViaYul: also
// ----
// test() -> 7
@@ -0,0 +1,27 @@
contract D {
uint256 x;
constructor() public {
x = 7;
}
function f() public view returns (uint256) {
return x;
}
}
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;
}
}
// ====
// EVMVersion: >=constantinople
// ----
// test() -> 42