-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Description
🧐 Motivation
Currently, Paused
and Unpaused
events are hardcoded in contracts/utils/Pausable.sol
and contracts/utils/PausableUpgradeable.sol
. While these events are included in the ABI after compilation, customizing ABI visibility for different user groups—so they only load relevant parts into their wallets—requires manual editing of the ABI JSON.
Ideally, different interface files could be defined for different views and linked via inheritance. However, because these events are embedded directly in the implementation contracts, they cannot be reused in interface files without causing Event with same name and parameter types defined twice error.
. This is due to Solidity's restriction against redeclaring events.
📝 Details
To improve modularity and ABI customization, I propose moving the Paused
and Unpaused
events into a dedicated interface. Then, both Pausable.sol
and PausableUpgradeable.sol
can implement this interface.
This change would enable developers to selectively expose these events through interfaces without requiring manual modification of the ABI.
Overall, this idea can be applied to all errors and events embedded in implementation contracts like contracts-upgradeable/contracts/proxy/utils/Initializable.sol
and contracts-upgradeable/utils/PausableUpgradeable.sol