/permit2:permit2-nonce-managementfrom permit2
Bitmap nonce patterns for Permit2 signature replay protection. Use when generating nonces for SignatureTransfer permits.
Ships in permit2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Permit2 uses a bitmap nonce system for replay protection (not sequential).
(wordIndex << 8) | bitIndex// Simple, low collision risk for user-initiated flows
const nonce = BigInt(Date.now()) << 8n
// Shift by 8 = room for 256 retries within same timestamp second
let nonce = nextNonce++
try {
signature = await signTypedData(...)
} catch {
nonce = nextNonce++
}
async function getFreeNonce(owner: string): Promise<bigint> {
for (let wordPos = 0; wordPos < 100; wordPos++) {
const bitmap = await publicClient.readContract({
address: PERMIT2_ADDRESS,
abi: [{
inputs: [
{ name: 'owner', type: 'address' },
{ name: 'wordPos', type: 'uint256' }
],
name: 'nonceBitmap',
outputs: [{ name: 'bitmap', type: 'uint256' }],
stateMutability: 'view',
type: 'function'
}],
functionName: 'nonceBitmap',
args: [owner, BigInt(wordPos)]
})
if (bitmap !== MaxUint256) {
for (let bitPos = 0; bitPos < 256; bitPos++) {
if ((bitmap >> BigInt(bitPos)) & 1n === 0n) {
return (BigInt(wordPos) << 8n) | BigInt(bitPos)
}
}
}
}
throw new Error('No free nonce')
}
const nonce = BigInt(Date.now()) << 8n
const permit: SignatureTransfer.PermitTransferFrom = {
permitted: { token: tokenAddress, amount: amount },
nonce,
deadline: BigInt(Math.floor(Date.now() / 1000) + 1800n)
}
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
10 skills in this plugin
/permit2-addressesCanonical Permit2 contract addresses by chain. Use when configuring multi-chain support./permit2-allowance-flowComplete approval flow with reset-to-zero pattern. Use when implementing full ERC20 and Permit2 approval workflow./permit2-allowance-transferUses AllowanceTransfer for persistent token approvals. Use when user grants recurring spend authority to the protocol./permit2-router-witnessPermit2 Router Witness (Balancer V3)````skillGenerated from the plugin's indexed repository (cyotee/cyotee-claude-plugins) — no native marketplace selected
npx claudepluginhub p/cyotee-permit2-plugins-permit22 plugins ship this exact skill · first indexed Jul 20, 2026