Skip to content

Commit

Permalink
No more deploying LinearERC20Voting on mainnet and polygon when runni…
Browse files Browse the repository at this point in the history
…ng deployment script.
  • Loading branch information
adamgall committed Jul 6, 2024
1 parent c8349fa commit fc09be9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions deploy/core/010_deploy_LinearERC20Voting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", []);
};

Expand Down
14 changes: 14 additions & 0 deletions deploy/core/014_deploy_LinearERC20WrappedVoting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", []);
};

Expand Down

0 comments on commit fc09be9

Please sign in to comment.