solidity/test/libsolidity/semanticTests/salted_create/salted_create.sol
2020-01-23 21:20:01 +01:00

24 lines
479 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
// ----
// different_salt() -> true
// same_salt() -> true