You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🧐 Motivation
When MulticallUpgradeable is inherited in an upgradeable contract, using the contract with Upgrades Plugins would cause a validation error with
@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol:41: Use of delegatecall is not allowed
https://zpl.in/upgrades/error-002
However, the delegatecall in this context is not necessarily unsafe.
To get around this, users would currently need to provide an option to allow delegatecalls for the entire validation run, which could hide issues elsewhere.
📝 Details MulticallUpgradeable contains a delegatecall, but the target of that delegatecall is always address(this). This delegatecall can be considered safe as long as the contract including its dependencies does not have any exposed functions with selfdestruct.
Consider annotating MulticallUpgradeable with @custom:oz-upgrades-unsafe-allow delegatecall so that Upgrades Plugins will not raise a validation error for the delegatecall. Note that the Upgrades Plugins will still perform validations to ensure that the contract does not have selfdestructs.
The text was updated successfully, but these errors were encountered:
🧐 Motivation
When MulticallUpgradeable is inherited in an upgradeable contract, using the contract with Upgrades Plugins would cause a validation error with
However, the delegatecall in this context is not necessarily unsafe.
To get around this, users would currently need to provide an option to allow delegatecalls for the entire validation run, which could hide issues elsewhere.
📝 Details
MulticallUpgradeable contains a
delegatecall
, but the target of thatdelegatecall
is alwaysaddress(this)
. This delegatecall can be considered safe as long as the contract including its dependencies does not have any exposed functions withselfdestruct
.Consider annotating MulticallUpgradeable with
@custom:oz-upgrades-unsafe-allow delegatecall
so that Upgrades Plugins will not raise a validation error for the delegatecall. Note that the Upgrades Plugins will still perform validations to ensure that the contract does not have selfdestructs.The text was updated successfully, but these errors were encountered: