Most adapters in the system are not configurable and do not require factory authorization, but currently they are unconditionally authorized/unauthorized causing higher gas costs of factory upgrades (or anything that iterates over all factory targets).
It might make sense to add a second overloading of allowAdapter with additional argument bool configurable here:
|
} else if (selector == ICreditConfigureActions.allowAdapter.selector) { |
|
DeployParams memory params = abi.decode(callData[4:], (DeployParams)); |
|
address adapter = _deployAdapter(msg.sender, creditManager, params); |
|
address oldAdapter = ICreditManagerV3(creditManager).contractToAdapter(IAdapter(adapter).targetContract()); |
|
Call memory unauthorizeCall = _unauthorizeFactory(msg.sender, creditManager, oldAdapter); |
|
Call memory authorizeCall = _authorizeFactory(msg.sender, creditManager, adapter); |
|
Call memory allowCall = _allowAdapter(_creditConfigurator(creditManager), adapter); |
|
return oldAdapter != address(0) |
|
? CallBuilder.build(unauthorizeCall, authorizeCall, allowCall) |
|
: CallBuilder.build(authorizeCall, allowCall); |
The other option might be including the skipConfiguration getter in the adapter itself to avoid changes in the factory interface.
Most adapters in the system are not configurable and do not require factory authorization, but currently they are unconditionally authorized/unauthorized causing higher gas costs of factory upgrades (or anything that iterates over all factory targets).
It might make sense to add a second overloading of
allowAdapterwith additional argumentbool configurablehere:permissionless/contracts/factories/CreditFactory.sol
Lines 148 to 157 in f660f1a
The other option might be including the
skipConfigurationgetter in the adapter itself to avoid changes in the factory interface.