How does AAVE use proxies?
- Aave Protocol Aave
I am trying to understand how AAVE uses proxies in their smart contracts. I have noticed that most proxies, like OpenZeppelin, only have one implementation contract, which means I need one proxy per implementation contract. This seems like a cumbersome process.
I have also come across proxies with multiple implementations, such as the Diamond Standard. However, the Diamond Standard adds complexity and has received mixed reviews from trail of bits, consensys, and other sources.
So, my question is: Does AAVE use one proxy per implementation contract, or do they use proxies with multiple implementations? If they do use proxies with multiple implementations, do they use the Diamond Standard or something else?
Answers 1
AAVE uses a single implementation proxy. They use a custom implementation of the proxy pattern, which is different from the Diamond Standard. The AAVE proxy contract allows them to upgrade multiple implementation contracts without the need for deploying a new proxy contract for each implementation.
As you mentioned, the Diamond Standard is one approach to implementing a proxy contract with support for multiple implementation contracts. However, the complexity of the Diamond Standard has led some developers to seek alternative solutions. AAVE's custom implementation of the proxy pattern is one such alternative.
AAVE's implementation of the proxy pattern enables them to maintain a single proxy contract that can be used to upgrade multiple implementation contracts. This approach simplifies the upgrade process and reduces the deployment overhead. However, this does come with some trade-offs, such as reduced transparency in the upgrade process, since each implementation contract can have its upgrade function.
In summary, AAVE uses a custom implementation of the proxy pattern to support multiple implementation contracts in their smart contracts. This approach enables them to upgrade their contracts efficiently while minimizing the overhead of deployment.