Hi @frangio.. I'm going through a similar issue, not being able to deploy on Kovan:
ProviderError: The execution failed due to an exception.
at HttpProvider.request (/Users/santisiri/Ethereum/ubi/node_modules/hardhat/src/internal/core/providers/http.ts:46:19)
at LocalAccountsProvider.request (/Users/santisiri/Ethereum/ubi/node_modules/hardhat/src/internal/core/providers/accounts.ts:131:34)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at EthersProviderWrapper.send (/Users/santisiri/Ethereum/ubi/node_modules/@nomiclabs/hardhat-ethers/src/ethers-provider-wrapper.ts:13:20)
It is likely because the new contract is larger than the original one. What do you mean by enabling optimizations? On the compiler?
My upgrade code right now:
async function main() {
const UBIv2 = await ethers.getContractFactory("UBI");
console.log("Upgrading proxy contract...");
const UBIv2Address = await upgrades.upgradeProxy(deploymentParams.PROXY_CONTRACT_ADDRESS_KOVAN, UBIv2, { unsafeAllowCustomTypes: true });
console.log("Proxy has been upgraded with UBI contract at:", UBIv2Address);
}
It's a very odd situation, because we tested the deploy with 2 different repos working on the same code.. in one version, the upgrade works; while on the other version, I keep getting the ProviderError message... both using same exact configuration settings.
We first deploy the original contract using the same exact version we have on Mainnet:
Then we execute the prepare.js and upgrade.js scripts to do an upgrade:
So those 2 repos are identical? Are you sure it wasn't a coincidence that it worked in one and not the other?
Something that is confusing to me is that I don't see the .openzeppelin directory in your repository. This directory contains metadata about your current version that would be used to check upgrade safety.
I have .openzeppelin directory on the .gitignore file.
On the version that won't deploy (/DemocracyEarth/ubi/tree/sablier) I found 4 files:
project.json
kovan.json
mainnet.json
unknown-31337.json
On the version that deploys (/JuanuMusic/ubi/UIP-1-Sablier-upgrade) I found 2 files:
kovan.json
unknown-31337.json
kovan.json looks significantly larger on the first one than the last one. Should I dump the content here? Maybe erasing these files does the trick when trying a new upgrade?
.openzeppelin should not be in .gitignore. From the docs:
Public network files like mainnet.json or ropsten.json should be tracked in version control. These contain valuable information about your project’s status in the corresponding network, like the addresses of the contract versions that have been deployed. Such files should be identical for all the contributors of a project.
However, local network files like unknown-<chain_id>.json only represent a project’s deployment in a temporary local network such as ganache-cli that are only relevant to a single contributor of the project and should not be tracked in version control.
(Sorry if this was not clearer.)
Please share the kovan.json files so I can try to reproduce the issue.