solidity/test/libsolidity/semanticTests/salted_create/salted_create.sol
Daniel Kirchner 1a0605c594 Update tests.
2021-11-03 12:39:55 +01:00

28 lines
588 B
Solidity

contract B
{
}
contract A {
function different_salt() public returns (bool) {
B x = new B{salt: "abc"}();
B y = new B{salt: "abcef"}();
return x != y;
}
function same_salt() public returns (bool) {
B x = new B{salt: "xyz"}();
try new B{salt: "xyz"}() {} catch {
return true;
}
return false;
}
}
// ====
// EVMVersion: >=constantinople
// compileViaYul: also
// ----
// different_salt() -> true
// same_salt() -> true
// gas irOptimized: 98438914
// gas legacy: 98439116
// gas legacyOptimized: 98438970