diff --git a/deploy/core/010_deploy_LinearERC20Voting.ts b/deploy/core/010_deploy_LinearERC20Voting.ts index 822bfade..f5e4b77c 100644 --- a/deploy/core/010_deploy_LinearERC20Voting.ts +++ b/deploy/core/010_deploy_LinearERC20Voting.ts @@ -3,6 +3,20 @@ import { DeployFunction } from "hardhat-deploy/types"; import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const chainId = await hre.getChainId(); + + // On mainnet and polygon, this contract is slightly + // different than all other chains, which is the current version + // of LinearERC20Voting.sol. + // So, this will deploy on mainnet and polygon, because + // the current version of the contract wasn't deployed. + // It would be nice to just deploy the updated version and + // tell the frontend to start using it (it is an implenentation master + // copy after all), but I don't think it's that easy. + if (chainId === "1" || chainId === "137") { + return; + } + await deployNonUpgradeable(hre, "LinearERC20Voting", []); }; diff --git a/deploy/core/014_deploy_LinearERC20WrappedVoting.ts b/deploy/core/014_deploy_LinearERC20WrappedVoting.ts index 436d9614..ea3cb00d 100644 --- a/deploy/core/014_deploy_LinearERC20WrappedVoting.ts +++ b/deploy/core/014_deploy_LinearERC20WrappedVoting.ts @@ -3,6 +3,20 @@ import { DeployFunction } from "hardhat-deploy/types"; import { deployNonUpgradeable } from "../helpers/deployNonUpgradeable"; const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const chainId = await hre.getChainId(); + + // On mainnet and polygon, this contract is slightly + // different than all other chains, which is the current version + // of LinearERC20Voting.sol. + // So, this will deploy on mainnet and polygon, because + // the current version of the contract wasn't deployed. + // It would be nice to just deploy the updated version and + // tell the frontend to start using it (it is an implenentation master + // copy after all), but I don't think it's that easy. + if (chainId === "1" || chainId === "137") { + return; + } + await deployNonUpgradeable(hre, "LinearERC20WrappedVoting", []); };