[M1: Audit 2: L-12]: CIP112: Pin allocation and holding policies to a template type
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- markdown
- Domain
- blockchain
Research direction
Start with the Holding.daml and Registry.daml references in the issue, then inspect Custom.daml, the token-cip112-utils-test harness, and the linked README and changelog sections. Update the signatures and call sites as specified, document the unchecked custom spend-hook and archive-bypass caveats, and run the relevant utility tests. Done when all named call sites and documentation reflect the new constraints and the one-allocation-template-per-batch limit.
Written by the indexing model from the issue text.
Description
Addresses L-12
Changes
Code:
pinAllocationToandconsumeByArchiveshould requireHasEnsure t. Of the template classes, it is the only one an interface does not satisfy.Template twould not help, because interfaces satisfy it in SDK 3.5.settleBatchImplandexpireAllocationsImplshould take the accepted allocation template as a type argument with the same constraint, instead of aPinAllocationfunction. A registry then cannot omit the pin or write it as an interface fetch. Update the call sites inTokenRules,MyRulesand thetoken-cip112-utils-testharness.
Documentation:
- The
consumeHoldinglaw, theHolding.damlmodule comment and the trust boundary in thetoken-cip112-utilsREADME.mdshould say three things:consumeHoldingmust be built fromconsumeByArchive @T, or from a spend choice reached throughfetchFromInterfaceat a template type.- The compiler checks only the first.
consumeByArchiveskips any spend choice the template defines.
- Update the
README.mdentries that describePinAllocationandpinAllocationToto match the new signatures, and add aCHANGELOG.mdentry for the signature change.
Complications
- Custom spend hooks stay unchecked.
myOpsreachesMyHolding_SpendthroughfetchFromInterface @MyHolding.fetchFromInterface @Holdingalso compiles, so this path is protected only by the documented law. consumeByArchivebypasses spend rules.consumeByArchive @MyHoldingarchives a frozen holding without callingMyHolding_Spend. The documentation must not presentconsumeByArchiveas a drop-in replacement for templates that have a spend rule.- One allocation template per batch. A type argument accepts exactly one allocation template, and a
PinAllocationfunction could accept several. No shipped registry uses more than one, and SCU upgrades keep the template identity. TheREADME.mdshould state the limit.
- Dominant language
- Haskell
- Stars
- 5
- Forks
- 0
- Avg merge
- 1d 36m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from OpenZeppelin/canton-contracts
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenZeppelin/canton-contracts#92 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
OpenZeppelin/canton-contracts#88 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenZeppelin/canton-contracts#86 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
OpenZeppelin/canton-contracts#95 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
OpenZeppelin/canton-contracts#94 ·
Maintainers usually reply within 1 day
All issues in OpenZeppelin/canton-contracts
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
hasura/graphql-engine#10954 ·
Maintainers usually reply within 1 day