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"],
},