I'm aware since Spurious Dragon there's a size limit for the contracts, I cloned this repository to test it locally and learn about how everything works, but I can't deploy some contracts due to the size being larger than the limit.
I'm using hardhat and my deploy script looks something like this:
async function main() {
const Comptroller = await ethers.getContractFactory('Comptroller');
const comptroller = await Comptroller.deploy();
console.log("comptroller deployed to:", comptroller.address);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
This is on my hardhat.config:
module.exports = {
solidity: "0.5.16",
settings: {
optimizer: {
enabled: true,
runs: 20
}
},
networks: {
testnet: {
url: secret.url,
gasPrice: 20000000000,
accounts: [secret.key]
}
This is what I'm using to deploy:
npx hardhat --network testnet run scripts/deploy1.js
I'm getting the error from the deployment that the size of the contracts is too large, so how can they have deployed the same code that is exceeding the size and I'm not able to deploy it?
ProviderError: max code size exceeded at HttpProvider.request at LocalAccountsProvider.request at processTicksAndRejections at EthersProviderWrapper.send
allowUnlimitedContractSize
to support arbitrary large contracts.