OpenZeppelin / OpenZeppelin/compact-contracts
Followup: `Ownable refactor -> replace pk with sk #466`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
Generalize Either<Bytes<32>, ContractAddress> helpers into Utils
Several Ownable circuits hand-roll the same Left<Bytes<32>, _> plumbing.
Lift them into Utils.compact so AccessControl / Fungible can share.
-
_unsafeUncheckedTransferOwnership(left<Bytes<32>, ContractAddress>(default<Bytes<32>>))— the verboseEitherliteral in renounce/zero paths.
Refs: L191, author agreed in r3167454830 / r3167769096. - Generalized
isContractAddress(carried over from the AC PR discussion).
Refs: L240, L138, confirmed r3202262467. - Generalize
isKeyOrAddressZero(or at least itsLeftside).
Refs: L321 / L321, confirmed r3202256488.
Shared AccountId module
Ownable now carries _computeAccountId + the secret-key witness pattern.
AccessControl (and any future identity-bearing module) will want the same
primitives. Consider an AccountId module that owns only the state and
circuits and is composed into the rest.
Ref: L310.
Polish
- Tighten the header note on contract-owner authentication: until C2C
calls land, a contract simply cannot authenticate as owner.
Ref: r3167041751. - Style nit:
assert(_computeAccountId() == _owner.left, "Ownable: caller is not the owner");in_assertOnlyOwner.
Ref: r3166987733.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Ownable circuits and the existing Utils.compact helpers, then compare the AccessControl and Fungible needs described here. Determine how the shared AccountId primitives and generalized Either helpers should be composed, and verify that the listed Ownable cleanup items and shared-use cases are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100