The DTokenProxy contract is an implementation of the OpenZeppelin AdminUpgradeabilityProxy. The following lines have been commented out from that parent contract:
// require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
By having the _fallback() call included in the modifier, it allows the implementations to define functions such as admin() and pendingAdmin(). Currently, these functions would be captured by the proxy instead of being delegated to the underlying implementation.
The reason for this modification is unclear. If it provides some benefit, this should be documented. Otherwise introducing modifications like this can have unintended side effects.
Severity: Code Quality
Description
The DTokenProxy contract is an implementation of the OpenZeppelin
AdminUpgradeabilityProxy
. The following lines have been commented out from that parent contract:By having the
_fallback()
call included in the modifier, it allows the implementations to define functions such asadmin()
andpendingAdmin()
. Currently, these functions would be captured by the proxy instead of being delegated to the underlying implementation.The reason for this modification is unclear. If it provides some benefit, this should be documented. Otherwise introducing modifications like this can have unintended side effects.