Hi OZ team,
Noticed that ERC2771ContextUpgradeable does not come with an _init() and was wondering how to get a factory to deploy a BeaconProxy that takes in the function call to initiate the implementation contract that inherits ERC2771ContextUpgradeable that its UpgradeableBeacon is pointing to?
Simplified AContract contract code:
contract AContract is ERC2771ContextUpgradeable, AccessControlEnumerableUpgradeable {
constructor(address trustedForwarder)
ERC2771ContextUpgradeable(trustedForwarder) {
initialize();
_disableInitializers();
}
/// Initializes the contract
/// @dev Uses the initializer modifier to to ensure the contract is only initialized once
function initialize() initializer public {
__AccessControl_init();
}
}
Simplified AFactory contract:
contract AFactory {
function createAContract(address trustedForwarder) public {
BeaconProxy beaconProxy = new BeaconProxy(beaconAddress,
abi.encodeWithSelector(AContract(address(0)).initialize.selector, trustedForwarder));
}
}