Conversation
shenkeyao
left a comment
There was a problem hiding this comment.
A general question: why do we inherit OpenZeppelin's UUPSUpgradeable? For OP, we decided to follow the transparent proxy pattern since that's what Celo does. I guess we can use UUPS here because this repo isn't for OP only, but is this strictly needed?
yea I think we should use transparent proxy here as well, I have used that in my PR |
9bec124 to
e312610
Compare
- Add OwnableWithGuardiansUpgradeable combining Ownable2Step, AccessControlEnumerable, and UUPS - Define GUARDIAN_ROLE with onlyOwner, onlyGuardian, and onlyGuardianOrOwner modifiers - Convert EspressoTEEVerifier, EspressoSGXTEEVerifier, EspressoNitroTEEVerifier to UUPS upgradeable - Update TEEHelper base contract to use OwnableWithGuardiansUpgradeable - Update setEnclaveHash() and deleteEnclaveHashes() to onlyGuardianOrOwner - Update all deployment scripts to use ERC1967Proxy pattern - Add optional initial enclave hash setting in deployment scripts - Update all tests for proxy deployment and guardian error types - Add comprehensive test coverage (39 tests for OwnableWithGuardiansUpgradeable)
e312610 to
8df3377
Compare
Sneh1999
left a comment
There was a problem hiding this comment.
Can you also update all tests which were currently testing only owner can update the values to also guardian can update the values? 🙏
Sneh1999
left a comment
There was a problem hiding this comment.
we might also have toy update the deployment and tests scripts to specify a guradian address when deploying the Espresso tee contract 🤔
|
@Sneh1999 I ran into issues with OZ and OZ-upgradeable being of incompatible versions, I don't remember the specific error. Addressed other comments. |
Closes #<ISSUE_NUMBER>
This PR:
OwnableWithGuardiansUpgradeableabstract contract that mostly inherits from OpenZeppelin'sOwnable2Step,AccessControlEnumerableandUUPSUpgradeable, only adding some convenience functions to predefine the guardian rolesetEnclaveHash()anddeleteEnclaveHashes()callable by guardiansThis PR does not:
Key places to review:
src/OwnableWithGuardiansUpgradeable.solfor the new contract itselfsrc/TEEHelper.solandsrc/EspressoTEEVerifier.solfor usage of it