upgradeTo
nonpayable
Use this function in your app
const response = await fetch('https://api.thirdweb.com/v1/contracts/write', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-secret-key': '<YOUR_SECRET_KEY>'
},
body: JSON.stringify({
calls: [
{
contractAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
method: "function upgradeTo(address newImplementation)",
params: [newImplementation]
}
],
chainId: 1,
from: "<YOUR_WALLET_ADDRESS>"
})
});
const data = await response.json();