Skip to content

CIP-0112: one-step and two-step mint through the transfer factory - #64

Open
pepebndc wants to merge 7 commits into
mainfrom
cip112-one-step-mint
Open

pepebndc wants to merge 7 commits into
mainfrom
cip112-one-step-mint

Conversation

@pepebndc

@pepebndc pepebndc commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

A transfer from the CIP-0112 mint account (cip-112/mint) is a mint. TransferFactory_Transfer handles it with the same actor rule as transfers and burns. The mint takes no input holdings and locks nothing. TokenRules_OfferMint and offerMintImpl are removed, so every mint goes through a standard factory.

actors result
[admin] Pending mint offer. The receiver accepts or rejects it.
[admin] + receiver account parties Completed mint, no instruction.
any other set Refused.

Tests:

  • testMintOneStep: holding created, no instruction, no lock, one event that names the mint account.
  • testOfferMintAuthorityAndBounds: a mint without the admin, or with extra actors, fails. Amount and TTL bounds apply.
  • testMintRefusesSpecialReceiverAndInputs: a mint to a special account or with input holdings fails.
  • testMintStepsFollowReceiverAccount: [admin] completes a mint to the admin's own account. A mint to a second account of alice needs alice for one step.
  • testMintToProviderAccount: a mint to an account with a provider needs the owner and the provider, in one step or on acceptance.
  • testMintRefusesOutOfWindow: a mint outside its requestedAt and executeBefore bounds fails, in both flows.
  • testTransferEventReason: a mint with no reason gets "tokens minted".
  • Custom example: testPauseBlocksFactories covers the one-step mint, and testMintPaysNoFee shows that a mint pays no fee.

Stacked on #63.

@pepebndc
pepebndc marked this pull request as ready for review October 20, 2026 10:59
Base automatically changed from cip112-default-accounts to cip112-apache-alignment October 20, 2026 13:53
Base automatically changed from cip112-apache-alignment to igingu-cip112-simplification-and-rad October 20, 2026 14:02
@0xNeshi
0xNeshi force-pushed the cip112-one-step-mint branch from e44d4e6 to 9ff73de Compare October 21, 2026 07:26
Base automatically changed from igingu-cip112-simplification-and-rad to main October 21, 2026 09:46

@0xNeshi 0xNeshi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new tests in #65

@0xNeshi
0xNeshi force-pushed the cip112-one-step-mint branch from 9ff73de to 8ac6bb9 Compare October 21, 2026 14:02
0xNeshi added a commit that referenced this pull request Oct 21, 2026
@0xNeshi
0xNeshi force-pushed the cip112-one-step-mint branch from 2709e9c to e9aa7da Compare October 23, 2026 11:08
0xNeshi added a commit to OpenZeppelin/canton-specs that referenced this pull request Oct 23, 2026
**Proposal**
- **Refunds:** A no-mint refund needs a closed nonce, and a close never
overwrites a mint.
- **`E`:** The epoch size lives on the nonce registry, which refuses
nonces from other epochs.
- **Lock record:** The nonce registry records each lock's amount and
recipient. A re-offer checks both and runs at most once, and a refund
checks the amount.
- **Trust in `br`:** Section 4.2 says `br` alone can close a live lock
or hold a returned credit.
- **Disclosure:** `br` discloses the nonce registry versions and claims
it witnesses. `ba`'s backend serves everything else, including the pause
state to `pa`.
- **Consistency:**
  - `ba` "submits nothing" now applies only to the payment path.
- New failure rows for a downed backend and a downed wTOK admin
participant.
  - Renames: "no-mint statement", "redemption claim", "request id".
- Answer to Curtis's partial-release question, and a definition of the
split field `s`.
  - Reward split updated to 65.1/20.6/14.3%.

**Prototype**
- **Registry and gateways:** `E` is on `NonceRegistry` with its own
epoch check, and a `LockRecord` is carried in the minted and returned
states. Re-offer, refund and hold enforce it, and the gateways no longer
carry `E`.
- **Tests and `README.md`:** New and updated tests cover these checks,
and `README.md` matches.
- **Latest OZ CIP112 Deps:** Use the latest
OpenZeppelin/canton-contracts CIP112 packages that include [one-step
mints](OpenZeppelin/canton-contracts#64)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants