What is the right way to call TransparentUpgadeableProxy.changeAdmin()?

In my deploy script I am calling truffle-upgrades deployProxy.
It automatically deploys a TransparentUpgadeableProxy and a ProxyAdmin.

From the truffle test js file, how can I call the TransparentUpgadeableProxy.changeAdmin() of the deployed contract? I don't have the original TransparentUpgadeableProxy solidity file to get the abi from, and doing this:

let data = web3.eth.abi.encodeFunctionCall(
{
  "name": "changeAdmin",
  "type": "function",
  "inputs":[
    {
      "name": "newAdmin",
      "type": "address"
    }
  ]
})
await web3.eth.sendTransaction({from:deployer, to: Contract.address, data:data, value: newAddess},
function(err, transactionHash) { if (err) { console.log(err); } else { console.log(transactionHash);

gives me TypeError: Cannot read property 'map' of undefined.

I want to test my that proxy cannot be upgraded by anyone else but the admin.
Am I going about this the right way?
tia.

Nvn, sorry I should have read more, it's at the end of https://docs.openzeppelin.com/upgrades-plugins/1.x/

2 Likes