gnosis/safe/safe_service.py
def deploy_paying_proxy_contract(self, initializer=b'', deployer_account=None, deployer_private_key=None) -> str:
        """
        Deploy proxy contract. Takes deployer_account (if unlocked in the node) or the deployer private key
        :param initializer: Initializer
        :param deployer_account: Unlocked ethereum account
        :param deployer_private_key: Private key of an ethereum account
        :return: deployed contract address
        """
        assert deployer_account or deployer_private_key
        deployer_address = deployer_account or self.ethereum_client.private_key_to_address(deployer_private_key)

        safe_proxy_contract = get_paying_proxy_contract(self.w3)
        tx = safe_proxy_contract.constructor(self.master_copy_address, initializer,
                                             NULL_ADDRESS,
                                             NULL_ADDRESS, 0).buildTransaction({'from': deployer_address})

        tx_hash = self.ethereum_client.send_unsigned_transaction(tx, private_key=deployer_private_key,
                                                                  public_key=deployer_account)
        tx_receipt = self.ethereum_client.get_transaction_receipt(tx_hash, timeout=60)
        assert tx_receipt.status
        return tx_receipt.contractAddress
def deploy_paying_proxy_contract(self, initializer=b'', deployer_account=None, deployer_private_key=None) -> str:
        """
        Deploy proxy contract. Takes deployer_account (if unlocked in the node) or the deployer private key
        :param initializer: Initializer
        :param deployer_account: Unlocked ethereum account
        :param deployer_private_key: Private key of an ethereum account
        :return: deployed contract address
        """
        assert deployer_account or deployer_private_key
        deployer_address = deployer_account or self.ethereum_client.private_key_to_address(deployer_private_key)

        safe_proxy_contract = get_paying_proxy_contract(self.w3)
        tx = safe_proxy_contract.constructor(self.master_copy_address, initializer,
                                             NULL_ADDRESS,
                                             NULL_ADDRESS, 0).buildTransaction({'from': deployer_address})

        tx_hash = self.ethereum_client.send_unsigned_transaction(tx, private_key=deployer_private_key,
                                                                  public_key=deployer_account)
        tx_receipt = self.ethereum_client.get_transaction_receipt(tx_hash, timeout=60)
        assert tx_receipt.status
        return tx_receipt.contractAddress
Deploy proxy contract. Takes deployer_account (if unlocked in the node) or the deployer private key
        :param initializer: Initializer
        :param deployer_account: Unlocked ethereum account
        :param deployer_private_key: Private key of an ethereum account
        :return: deployed contract address