[M1: Audit 2: L-10]: CIP112: Add merge and split choices on holdings and document rebalancing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- blockchain
- Domain
- blockchain
Research direction
Start by reading packages/token/token-cip112-v1/daml/OpenZeppelin/Token/Cip112/V1/Holding.daml and the reusable function area in packages/token/token-cip112-utils; then inspect the MyHolding choices in examples/token/token-cip112-custom/daml/OpenZeppelin/Examples/Token/Cip112/Custom.daml. Done means merge and split enforce the stated account, instrument, lock, value-conservation and freeze rules, emit the specified event, and the README and integration guide document rebalancing and policy limitations.
Written by the indexing model from the issue text.
Description
Addresses L-10
Changes
Code:
- Add merge and split choices to
TokenHolding. The account parties control them, and the body is a reusable function intoken-cip112-utils. They should conserve value, accept only same-account, same-instrument inputs, reject live-locked inputs, and emit a holdings-change event with no transfer legs. - Reject any lock, even an expired one, on the holding the choice is exercised on. Its lock holders would otherwise witness the whole merge, including the account's other holdings and the consolidated amount.
- Add the choices to
MyHoldinginCustom.damlwith a freeze check. Without it, merging a frozen holding would unfreeze it. Related #82
Documentation:
- The
token-cip112-v1README.mdandintegration-guide.mdshould describe rebalancing through the new choices and through a self-transfer. Wallets that only use theHoldingV2.Holdinginterface cannot see template choices, as withTokenHolding_OwnerUnlock. - The
README.mdshould state that merges and splits bypass the registry's transfer policy, so they cannot be gated, charged or paused. - The utils documentation should state that custom templates must apply their own spend rules, such as a freeze, to the holding the choice is exercised on.
- 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