fix: use AccessControlUpgradeable #43
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to upgrade the access control mechanism in various smart contracts and update dependencies in the
package.jsonfile. The most important changes include replacingAccessControlwithAccessControlUpgradeablein multiple contracts and updating the OpenZeppelin contracts version.Use AccessControlUpgradeable (or similar *Upgradeable contracts) for upgradeable contracts to ensure compatibility and proper initialization. Using AccessControl in an upgradeable context will result in uninitialized state, potential security risks, and failure to follow upgradeability patterns.
Access Control Upgrades:
contracts/AgentRewardV2.sol: ReplacedAccessControlwithAccessControlUpgradeableto allow for upgradeable access control. [1] [2]contracts/AgentRewardV3.sol: Updated to useAccessControlUpgradeableinstead ofAccessControl. [1] [2]contracts/virtualPersona/AgentFactory.sol: Switched fromAccessControltoAccessControlUpgradeablefor upgradeable access control. [1] [2]contracts/virtualPersona/AgentFactoryV3.sol: Changed to useAccessControlUpgradeablein place ofAccessControl. [1] [2]contracts/virtualPersona/AgentFactoryV4.sol: Modified to useAccessControlUpgradeableinstead ofAccessControl. [1] [2]Dependency Updates:
package.json: Updated@openzeppelin/contractsto version5.1.0and@openzeppelin/contracts-upgradeableto version5.1.0.