This PR moves the relevant info for identifying and using adapters to the adapter contracts. Previously, this was not possible because of the way we call adapters (via a delegatecall), but it is not possible to dynamically define immutable constants at deploy time (i.e., the integration gateway address for the adapter).
Notes:
moved adapter "gateway" from Registry into an immutable type on the adapters themselves
added a required identifier() function to adapters via an IIntegrationAdapter interface, and require that only 1 adapter per identifier exist in the Registry. This is prevent having multiple versions of the same adapter registered. (we do the same for policies and fees in those respective PRs)
removed the concept of integrationType entirely. Some adapters can have multiple types, e.g., a CompoundAdapter could be both lending and borrowing. In terms of policies, it makes more sense to (dis)allow function sigs (e.g., allow lend but disallow borrow)
This PR moves the relevant info for identifying and using adapters to the adapter contracts. Previously, this was not possible because of the way we call adapters (via a delegatecall), but it is not possible to dynamically define
immutable
constants at deploy time (i.e., the integration gateway address for the adapter).Notes:
immutable
type on the adapters themselvesidentifier()
function to adapters via anIIntegrationAdapter
interface, and require that only 1 adapter per identifier exist in the Registry. This is prevent having multiple versions of the same adapter registered. (we do the same for policies and fees in those respective PRs)integrationType
entirely. Some adapters can have multiple types, e.g., aCompoundAdapter
could be both lending and borrowing. In terms of policies, it makes more sense to (dis)allow function sigs (e.g., allow lend but disallow borrow)