TicketStubClaimer: add claimTicketStubFor + OZ 5.x port#369
Open
magent-cryptograss wants to merge 4 commits into
Open
TicketStubClaimer: add claimTicketStubFor + OZ 5.x port#369magent-cryptograss wants to merge 4 commits into
magent-cryptograss wants to merge 4 commits into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three commits to prep the ticket-stub claim contract for our gasless-flow architecture and deployment from blox-office.
Commits
61db076— AddclaimTicketStubForfor relayer/gasless claimsSibling to
claimTicketStubthat takes an explicitrecipientparameter. Mints torecipientrather thanmsg.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 onrecipient. The secret remains the bearer instrument — whoever holds it can authorize a mint to any address.459f04a— Port to OpenZeppelin 5.xblox-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.sol→utils/ReentrancyGuard.solconstructor()→constructor(address initialOwner) ... Ownable(initialOwner)_exists(tokenId)→_ownerOf(tokenId) != address(0)intokenURI08ca5dc— Remove duplicate.solfrom arthelThe 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.jsstays 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).Follow-up
src/abi/ticketStubClaimerABI.jswill need regenerating from the deployed contract once mainnet deploy lands (task Simple version of the Contribute contract #12).Test plan
claimTicketStubForreads as a clean sibling_ownerOfusage)npm test -- __tests__/ticket_stub_claimer_test.js→ 32 pass