Yes, generally, but then you have cases like this
Now I'm trying to figure out the same thing as OP, what do you have to pass into deployProxy to get this to work?
const MyContract = await hre.ethers.getContractFactory("MyContract");
myContract = await hre.upgrades.deployProxy(MyContract, [forwarderAddress]);
await myContract.deployed();
The above just gives me the following error:
Error: types/values length mismatch (count={"types":1,"values":0}, value={"types":[{"name":"forwarder","type":"address","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"address","_isParamType":true}],"values":[]}, code=INVALID_ARGUMENT, version=abi/5.7.0)
This is the contract code:
contract MyContract is
Initializable,
ERC2771ContextUpgradeable
{
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address forwarder)
ERC2771ContextUpgradeable(forwarder)
{}
function initialize(string memory _tokenURI) public initializer {
_setTokenUri(0, _tokenURI);
}
}
I reached a dead-end here