Control contract creation from address

:computer: Environment
@openzeppelin/contracts-upgradeable@3.4.1-solc-0.7-2
Truffle v5.3.4

:memo:Details

I would like to control the account from which the proxy is deployed.
Background: With a special ethereum address it’s possible to control the outcoming contract address. Since the contract will be called multiple times with token interactions it’s preferred that the address contains multiple 0-bytes (i.e. https://vanity-eth.tk/).

Is there a way to control the account from which the proxy deployer is sourcing?

My setup would be:
Acc 1: Admin Address
Acc 2: Special Vanity Address

Way of working for the transparent proxy would be:

  1. deploy Implementation from Acc 1
  2. deploy proxyAdmin from Acc 1
  3. deploy Proxy from Vanity Acc 2
  4. transfer Proxy Ownership from Acc2 to Acc1

Problem: There seems to be no way of controlling which account is used to deploy the Proxy, correct?

Proposal would be something like:
const instance = await deployProxy(Box, [], { deployer: deployer,from: accounts[4]});

You would control the proxy itself. Make and deploy your own Proxy Admin with your own ownership controlling function.

This is correct, unfortionally then i can’t make use of the package and it’s controlling function with updates anymore. So new implementations are not checked for compatibility
It seems a proxy deployement can’t be registered from an already existing deployment:

const { deployProxy, upgradeProxy, admin, prepareUpgrade } = require('@openzeppelin/truffle-upgrades');
const TestImplementation = artifacts.require("OpenZapTester");
const ProxyAdmin = artifacts.require("@openzeppelin/contracts/ProxyAdmin");
const TransProx = artifacts.require("@openzeppelin/contracts/TransparentUpgradeableProxy");

module.exports = async function(deployer, network, accounts) {

  await deployer.deploy(ProxyAdmin,{from:accounts[4]})
  const proxAdminInst = await ProxyAdmin.deployed()

  const ZapperInst = await deployer.deploy(TestImplementation ,{from:accounts[4]})
  const TransProxInst = await deployer.deploy(TransProx,ZapperInst.address,proxAdminInst.address,"0x")

  const instance = await upgradeProxy(TransProxInst.address, Zapper, { deployer: deployer}); //FAILS

The upgradeProxy call fails of course then with:
Error: Proxy admin is not the one registered in the network manifest

I think it’s a variable in either one of these

const ProxyAdmin = artifacts.require("@openzeppelin/contracts/ProxyAdmin");
const TransProx = artifacts.require("@openzeppelin/contracts/TransparentUpgradeableProxy");

You’ll need to find out if there is a variable stopping you from controlling correctly.