[M1: Audit 2: L-07]: CIP112: Document creation-time policy and check the pause at delivery in the custom example
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 65/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- blockchain, documentation
Research direction
Start with the token-cip112-v1 and token-cip112-utils READMEs, the integration guide, and the custom example's README.md; then inspect MyTransferInstruction, MyAllocation, and the MyRules_Pause and MyRules_Unpause choices. Follow how choice context supplies extraArgs and how the rules contract is fetched. Done means the docs explain creation-time policy and accounting corrections, and the custom example checks pause status at delivery with consuming pause and unpause choices.
Written by the indexing model from the issue text.
Description
Addresses L-07
A pending transfer instruction or allocation is accepted, rejected, withdrawn, settled or cancelled on the pending contract itself, not on the rules contract. Any policy a consumer writes in a factory body, such as a pause, an allowlist, a cap or a fee, is therefore checked only when the pending contract is created. The default TokenRules has no such policy, so the default templates are not affected.
A consumer that needs policy or accounting at delivery owns its pending templates. Each choice already receives the full choice argument, including extraArgs, so the template can resolve its rules contract from the choice context before calling the -utils body. It can also correct its accounting after a reject, withdraw or cancel. This is the pattern Splice's Amulet follows on accept. -utils and the default templates are unchanged.
Documentation:
- the
token-cip112-v1andtoken-cip112-utilsREADMEs say that factory-side policy binds only at creation, and that consumers who count totals when an offer is made must correct them on reject, withdraw and cancel; - the integration guide shows how to check policy at delivery: resolve the rules contract from
extraArgs.context, fetch it as the consumer's template, check its admin, and rely on the fetch failing for an archived contract; - the custom example's
README.mdreplaces its pause caveat with a description of the check at delivery.
Custom example:
MyTransferInstructionaccept andMyAllocationsettle resolveMyRulesfrom the choice context and refuse delivery while the registry is paused;MyRules_PauseandMyRules_Unpauseare consuming, so a rules contract ID from before the pause cannot be replayed.
- 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 55/100
OpenZeppelin/canton-contracts#96 ·
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
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