fix(contracts-sdk): claimAndMint(...) missing stakingContractAddress … #765
+16
−3
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.
WHAT
@zach-is-my-name : "
Description of the bug/issue
When I call claimAndMint(...) via the @lit-protocol/contracts-sdk, the SDK only passes 3 parameters (keyType, derivedKeyId, and signatures). However, on the deployed PKPNFT diamond facet, claimAndMint(...) requires a 4th parameter for the stakingContractAddress.
This mismatch leads to either:
Too many arguments errors if my facet expects only 3 parameters but the diamond has 4-arg logic in another place, or
Not enough arguments errors if the diamond facet truly wants all 4 (with stakingContractAddress) but the SDK only calls 3.
Expected Behavior
The SDK should allow me to supply an optional stakingContractAddress (as the 4th parameter) when calling claimAndMint.
The function signature in the SDK’s PKPNFT.sol/PKPNFT.d.ts (or relevant code) should match the on-chain diamond facet signature with all 4 parameters.
Actual Behavior
The SDK only exposes claimAndMint(...) with 3 parameters.
The on-chain PKPNFT facet has a claimAndMint(...) with 4 parameters, causing transaction failure or an ABI mismatch.
Proposed Solution
Update claimAndMint(...) calls in contracts-sdk.js (especially in pkpNftContractUtils.write.claimAndMint) to accept an optional fourth parameter for stakingContractAddress.
If it is not required for some networks, it could default to a zero address or a known address, but it should at least be an optional argument in the method signature.
Additional Context
Observed FunctionNotFound(bytes4 _functionSelector) or too many arguments revert when calling with or without a 4th param.
The snippet from contracts-sdk.js that calls claimAndMint shows [2, derivedKeyId, signatures] only.
Severity of the bug
Can't use the contracts-sdk"