2020-01-23 16:39:15 +00:00
|
|
|
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
|
|
|
|
// ----
|
|
|
|
// different_salt() -> true
|
|
|
|
// same_salt() -> true
|
2023-08-04 10:27:18 +00:00
|
|
|
// gas irOptimized: 98438895
|
2023-04-26 11:03:17 +00:00
|
|
|
// gas legacy: 98439109
|
2023-05-09 16:22:44 +00:00
|
|
|
// gas legacyOptimized: 98438967
|