Contract.methods ** is not a function using UUPS and web3

On the BSC testnet I have created the following Proxy (upgradeable) contract using UUPS:
0xe73585adad24f0994b794eb276561303e1f46a9a with a related implementation contract: 0x63d68a352ae2201a8ebb399801ea6f796f50d807.

I am using web3js to contact the contract using this setup:

const proxyAddress = "0xe73585adAd24f0994b794eB276561303E1F46A9a";
const abi = [{
  inputs: [],
  name: "migrate",
  outputs: [{ internalType: "bool", name: "", type: "bool" }],
  stateMutability: "payable",
  type: "function",

const web3 = new Web3(window.ethereum);
const contract = new web3.eth.Contract(abi, proxyAddress);

const contract = contract ;
const sender = localStorage.getItem(TOKEN_KEY);
    from: sender,
  .then((res) => {
    console.log("Success", res);
  .catch((err) => {

The abi is taken from the implementation contract - so I am using the proxy contract to envoke the web3.eth.Contract method and the abi from the implementation contract.

I get the following error:

"Uncaught TypeError: contract.methods.migrate is not a function"

I have tried to use contract.methods.implementation().migrate() and contract.functions.implementation().migrate(). But without any luck

I am currently using web3 v. 1.7.3.

I might be misunderstanding something but I am quite sure that you need to use the proxy contract address but the abi from the implementation contract?

Yes, exactly!

contract.methods.migrate() should work... I don't think this error is related to upgrades or proxies. I would recommend first trying to get it to work with a non-upgradeable deployment to see if that helps identify the issue.

By the way, the snippet you shared looks odd and I don't think that was the exact code you were using:

This would not execute successfully because you're redefining a const variable.