Skip to content

TicketStubClaimer: add claimTicketStubFor + OZ 5.x port#369

Open
magent-cryptograss wants to merge 4 commits into
cryptograss:productionfrom
magent-cryptograss:production
Open

TicketStubClaimer: add claimTicketStubFor + OZ 5.x port#369
magent-cryptograss wants to merge 4 commits into
cryptograss:productionfrom
magent-cryptograss:production

Conversation

@magent-cryptograss

Copy link
Copy Markdown
Contributor

Three commits to prep the ticket-stub claim contract for our gasless-flow architecture and deployment from blox-office.

Commits

  1. 61db076 — Add claimTicketStubFor for relayer/gasless claims
    Sibling to claimTicketStub that takes an explicit recipient parameter. Mints to recipient rather than msg.sender, so a gas-paying relayer (delivery-kid) can submit the claim tx on behalf of holders who don't have ETH on the deployment chain. Same validation order as the original, plus a zero-address check on recipient. The secret remains the bearer instrument — whoever holds it can authorize a mint to any address.

  2. 459f04a — Port to OpenZeppelin 5.x
    blox-office (deployment home) has OZ 5.0.2 installed and all sibling contracts (SetStone, LiveSet, etc.) already use OZ 5.x patterns. Three changes for the contract to compile there:

    • security/ReentrancyGuard.solutils/ReentrancyGuard.sol
    • constructor()constructor(address initialOwner) ... Ownable(initialOwner)
    • _exists(tokenId)_ownerOf(tokenId) != address(0) in tokenURI
  3. 08ca5dc — Remove duplicate .sol from arthel
    The canonical Solidity source now lives in cryptograss/blox-office alongside the Foundry deploy script (separate PR). The JS mock + test suite at __tests__/ticket_stub_claimer_test.js stays in arthel — it's a JS unit test of the claim logic, not a Solidity test, and doesn't need Foundry.

Test suite

32 JS tests pass (22 original + 10 new covering claimTicketStubFor — recipient routing, validation failures, and double-claim prevention across both entry points).

Test Suites: 1 passed, 1 total
Tests:       32 passed, 32 total

Follow-up

  • The ABI at src/abi/ticketStubClaimerABI.js will need regenerating from the deployed contract once mainnet deploy lands (task Simple version of the Contribute contract #12).
  • Companion PR on blox-office adds the contract + Foundry deploy script.

Test plan

  • Skim contract diff — claimTicketStubFor reads as a clean sibling
  • Verify new tests actually exercise the recipient-vs-caller distinction
  • Sanity-check the OZ 5.x port (constructor sig, _ownerOf usage)
  • npm test -- __tests__/ticket_stub_claimer_test.js → 32 pass

magent-cryptograss and others added 4 commits June 8, 2026 11:59
Sibling method to claimTicketStub that takes a recipient address parameter
and mints to that address rather than msg.sender. Enables a gas-paying
relayer to submit claims on behalf of holders who don't have funds on the
deployment chain.

The secret remains the bearer instrument; whoever holds it can authorize
a mint to any address. Same validation order as claimTicketStub, plus a
zero-address check on recipient.

Mock + 10 tests added covering recipient routing, validation failures,
and double-claim prevention across both entry points. All 32 tests pass.
blox-office (where this will be deployed from) has OZ 5.0.2 installed and
all sibling contracts (SetStone, LiveSet, etc.) use OZ 5.x patterns. Three
changes were required for the contract to compile in that environment:

- ReentrancyGuard import moved from `security/` to `utils/`
- Ownable constructor now requires an explicit initial owner address;
  TicketStubClaimer's constructor now takes `address initialOwner`
- `_exists(tokenId)` was removed in OZ 5.x; replaced with the equivalent
  `_ownerOf(tokenId) != address(0)` check in tokenURI

No behavioral change. All 32 JS tests still pass.
…office

The Solidity source now lives in cryptograss/blox-office alongside its
Foundry deploy script (scripts/DeployTicketStubClaimer.s.sol). The JS
mock + test suite at __tests__/ticket_stub_claimer_test.js stays in
arthel — it's a JS unit test of the claim logic, not a Solidity test,
and doesn't need Foundry.

The ABI at src/abi/ticketStubClaimerABI.js will need regenerating from
the deployed contract once we have a deploy (task cryptograss#12).
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