return address

This commit is contained in:
poma 2021-02-14 08:48:57 +03:00
parent 4dd141a398
commit c6526c7f02
No known key found for this signature in database
GPG Key ID: BA20CB01FE165657

View File

@ -16,8 +16,8 @@ contract Deployer {
event Deployed(address indexed sender, address indexed addr);
function deploy(bytes memory _initCode, bytes32 _salt) external {
address createdContract = deployer.deploy(_initCode, _salt);
function deploy(bytes memory _initCode, bytes32 _salt) external returns (address payable createdContract) {
createdContract = deployer.deploy(_initCode, _salt);
require(createdContract != address(0), "Deploy failed");
emit Deployed(msg.sender, createdContract);
}