threshold-network / solidity-contracts

39 stars 18 forks source link

`KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY` shouldn't be required by default for deployments #84

Open cygnusv opened 2 years ago

cygnusv commented 2 years ago

Trying to deploy something on mainnet I got this ropsten related error: Invalid account: #1 for network: ropsten - Expected string, received undefined

It seems that even though I'm deploying on mainnet, the ropsten accounts configuration is still processed and since process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY is set, it also expects process.env.KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY, which I shouldn't have set for deployments not related to legacy Keep.

For reference, this is ropsten config on hardhat.config.ts:

ropsten: {
      url: process.env.CHAIN_API_URL || "",
      chainId: 3,
      accounts: process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
        ? [
            process.env.CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY,
            process.env.KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY,
          ]
        : undefined,
      tags: ["tenderly"],
    },
michalinacienciala commented 2 years ago

@cygnus, so you were running something like "yarn deploy --network mainnet" or "hardhat deploy --network mainnet" and got an error related to ropsten network configuration? That looks like a bug in hardhat...

cygnusv commented 11 months ago

Bumping. This still happens.