[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EMM1SA1C4RCFS0X5MSRRWM":3,"skill-same:01M6EMM1SA1C4RCFS0X5MSRRWM":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6EMM1SA1C4RCFS0X5MSRRWM","pitfalls-blockchain",null,"Blockchain RPC error handling, gas estimation, multi-chain config, and transaction management. Use when interacting with smart contracts, estimating gas, or managing transactions. Triggers on: RPC, contract call, gas, multicall, nonce, transaction, revert.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fbarissozen\u002Fpitfalls-blockchain\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"pitfalls blockchain","blockchain","call","multi","error","chain","triggers","contract","multi-chain","transaction","estimation","config","contracts","use","gas","management","transactions","rpc","error handling","2026-11-10 10:12:30",false,"---\nname: pitfalls-blockchain\ndescription: \"Blockchain RPC error handling, gas estimation, multi-chain config, and transaction management. Use when interacting with smart contracts, estimating gas, or managing transactions. Triggers on: RPC, contract call, gas, multicall, nonce, transaction, revert.\"\n---\n\n# Blockchain Pitfalls\n\nCommon pitfalls and correct patterns for blockchain interactions.\n\n## When to Use\n\n- Making contract calls via RPC\n- Estimating gas for transactions\n- Handling reverts and errors\n- Managing nonces for concurrent txs\n- Configuring multi-chain support\n- Reviewing blockchain code\n\n## Workflow\n\n### Step 1: Verify Error Handling\n\nCheck all contract calls are wrapped in try\u002Fcatch.\n\n### Step 2: Check Gas Estimation\n\nEnsure gas is estimated with buffer before sending.\n\n### Step 3: Verify Multicall Safety\n\nConfirm multicall uses allowFailure: true.\n\n---\n\n## RPC Error Handling\n\n```typescript\n\u002F\u002F ✅ Wrap ALL contract calls\nasync function getQuote(tokenIn: Address, tokenOut: Address) {\n  try {\n    const quote = await quoter.quoteExactInput(...);\n    return quote;\n  } catch (error) {\n    \u002F\u002F Low-liquidity tokens WILL fail - this is expected\n    console.warn(`Quote failed for ${tokenIn}->${tokenOut}:`, error.message);\n    return null; \u002F\u002F Continue processing other tokens\n  }\n}\n\n\u002F\u002F ✅ Validate before calling contracts\nif (!isAddress(tokenAddress)) {\n  throw new Error('Invalid token address');\n}\n\n\u002F\u002F ✅ Handle \"execution reverted\" gracefully\nif (error.message.includes('execution reverted')) {\n  \u002F\u002F Pool doesn't exist or insufficient liquidity\n  return null;\n}\n\n\u002F\u002F ✅ Multicall with individual error handling\nconst results = await multicall({\n  contracts: tokens.map(t => ({ ... })),\n  allowFailure: true, \u002F\u002F CRITICAL\n});\nresults.forEach((result, i) => {\n  if (result.status === 'success') {\n    \u002F\u002F Use result.result\n  } else {\n    \u002F\u002F Log and skip this token\n  }\n});\n```\n\n## Gas Estimation\n\n```typescript\n\u002F\u002F ✅ Always estimate gas before sending\nconst gasEstimate = await contract.estimateGas.swap(...args);\n\n\u002F\u002F ✅ Add 10-20% buffer to gas estimates\nconst gasLimit = gasEstimate.mul(120).div(100);  \u002F\u002F 20% buffer\n\n\u002F\u002F ✅ EIP-1559 gas pricing\nconst feeData = await provider.getFeeData();\nconst tx = {\n  maxFeePerGas: feeData.maxFeePerGas,\n  maxPriorityFeePerGas: feeData.maxPriorityFeePerGas,\n  gasLimit,\n};\n\n\u002F\u002F ✅ Simulate before execution\ntry {\n  await contract.callStatic.swap(...args);  \u002F\u002F Dry run\n  const tx = await contract.swap(...args);  \u002F\u002F Real execution\n} catch (e) {\n  \u002F\u002F Would revert - don't send\n}\n\n\u002F\u002F ✅ Handle gas price spikes\nif (feeData.maxFeePerGas > MAX_ACCEPTABLE_GAS) {\n  throw new Error('Gas too high, waiting...');\n}\n```\n\n## Multi-Chain Configuration\n\n```typescript\n\u002F\u002F ✅ Chain-specific configuration\nconst CHAIN_CONFIG: Record\u003CChainId, ChainConfig> = {\n  ethereum: {\n    chainId: 1,\n    rpcUrl: process.env.ETHEREUM_RPC_URL,\n    blockTime: 12,\n    confirmations: 2,\n    nativeToken: 'ETH',\n  },\n  polygon: {\n    chainId: 137,\n    rpcUrl: process.env.POLYGON_RPC_URL,\n    blockTime: 2,\n    confirmations: 5,  \u002F\u002F More confirmations for faster chains\n    nativeToken: 'MATIC',\n  },\n};\n```\n\n## Transaction Management\n\n```typescript\n\u002F\u002F ✅ Wait for confirmations\nconst receipt = await tx.wait(2);  \u002F\u002F 2 confirmations\n\n\u002F\u002F ✅ Nonce management\nclass NonceManager {\n  private pending = new Map\u003CAddress, number>();\n\n  async getNextNonce(address: Address, provider: Provider): Promise\u003Cnumber> {\n    const onChain = await provider.getTransactionCount(address, 'pending');\n    const local = this.pending.get(address) ?? onChain;\n    const next = Math.max(onChain, local);\n    this.pending.set(address, next + 1);\n    return next;\n  }\n}\n```\n\n## Rate Limiting & Retry\n\n```typescript\n\u002F\u002F ✅ Exponential backoff\nasync function fetchWithRetry\u003CT>(fn: () => Promise\u003CT>, maxRetries = 3): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n    try {\n      return await fn();\n    } catch (error) {\n      if (error.status === 429) {  \u002F\u002F Rate limited\n        const delay = Math.pow(2, attempt) * 1000;\n        await sleep(delay);\n        continue;\n      }\n      throw error;\n    }\n  }\n  throw new Error('Max retries exceeded');\n}\n\n\u002F\u002F ✅ Fallback RPC endpoints\nconst RPC_ENDPOINTS = [\n  'https:\u002F\u002Feth-mainnet.alchemyapi.io\u002Fv2\u002FKEY',\n  'https:\u002F\u002Fmainnet.infura.io\u002Fv3\u002FKEY',\n  'https:\u002F\u002Frpc.ankr.com\u002Feth',\n];\n```\n\n## Quick Checklist\n\n- [ ] All contract calls wrapped in try\u002Fcatch\n- [ ] Multicall uses `allowFailure: true`\n- [ ] Gas estimation with 20% buffer\n- [ ] EIP-1559 gas pricing used\n- [ ] Transaction simulation before send\n- [ ] Nonce management for concurrent txs\n- [ ] Confirmations appropriate per chain\n","# Blockchain Pitfalls\n\nCommon pitfalls and correct patterns for blockchain interactions.\n\n## When to Use\n\n- Making contract calls via RPC\n- Estimating gas for transactions\n- Handling reverts and errors\n- Managing nonces for concurrent txs\n- Configuring multi-chain support\n- Reviewing blockchain code\n\n## Workflow\n\n### Step 1: Verify Error Handling\n\nCheck all contract calls are wrapped in try\u002Fcatch.\n\n### Step 2: Check Gas Estimation\n\nEnsure gas is estimated with buffer before sending.\n\n### Step 3: Verify Multicall Safety\n\nConfirm multicall uses allowFailure: true.\n\n---\n\n## RPC Error Handling\n\n```typescript\n\u002F\u002F ✅ Wrap ALL contract calls\nasync function getQuote(tokenIn: Address, tokenOut: Address) {\n  try {\n    const quote = await quoter.quoteExactInput(...);\n    return quote;\n  } catch (error) {\n    \u002F\u002F Low-liquidity tokens WILL fail - this is expected\n    console.warn(`Quote failed for ${tokenIn}->${tokenOut}:`, error.message);\n    return null; \u002F\u002F Continue processing other tokens\n  }\n}\n\n\u002F\u002F ✅ Validate before calling contracts\nif (!isAddress(tokenAddress)) {\n  throw new Error('Invalid token address');\n}\n\n\u002F\u002F ✅ Handle \"execution reverted\" gracefully\nif (error.message.includes('execution reverted')) {\n  \u002F\u002F Pool doesn't exist or insufficient liquidity\n  return null;\n}\n\n\u002F\u002F ✅ Multicall with individual error handling\nconst results = await multicall({\n  contracts: tokens.map(t => ({ ... })),\n  allowFailure: true, \u002F\u002F CRITICAL\n});\nresults.forEach((result, i) => {\n  if (result.status === 'success') {\n    \u002F\u002F Use result.result\n  } else {\n    \u002F\u002F Log and skip this token\n  }\n});\n```\n\n## Gas Estimation\n\n```typescript\n\u002F\u002F ✅ Always estimate gas before sending\nconst gasEstimate = await contract.estimateGas.swap(...args);\n\n\u002F\u002F ✅ Add 10-20% buffer to gas estimates\nconst gasLimit = gasEstimate.mul(120).div(100);  \u002F\u002F 20% buffer\n\n\u002F\u002F ✅ EIP-1559 gas pricing\nconst feeData = await provider.getFeeData();\nconst tx = {\n  maxFeePerGas: feeData.maxFeePerGas,\n  maxPriorityFeePerGas: feeData.maxPriorityFeePerGas,\n  gasLimit,\n};\n\n\u002F\u002F ✅ Simulate before execution\ntry {\n  await contract.callStatic.swap(...args);  \u002F\u002F Dry run\n  const tx = await contract.swap(...args);  \u002F\u002F Real execution\n} catch (e) {\n  \u002F\u002F Would revert - don't send\n}\n\n\u002F\u002F ✅ Handle gas price spikes\nif (feeData.maxFeePerGas > MAX_ACCEPTABLE_GAS) {\n  throw new Error('Gas too high, waiting...');\n}\n```\n\n## Multi-Chain Configuration\n\n```typescript\n\u002F\u002F ✅ Chain-specific configuration\nconst CHAIN_CONFIG: Record\u003CChainId, ChainConfig> = {\n  ethereum: {\n    chainId: 1,\n    rpcUrl: process.env.ETHEREUM_RPC_URL,\n    blockTime: 12,\n    confirmations: 2,\n    nativeToken: 'ETH',\n  },\n  polygon: {\n    chainId: 137,\n    rpcUrl: process.env.POLYGON_RPC_URL,\n    blockTime: 2,\n    confirmations: 5,  \u002F\u002F More confirmations for faster chains\n    nativeToken: 'MATIC',\n  },\n};\n```\n\n## Transaction Management\n\n```typescript\n\u002F\u002F ✅ Wait for confirmations\nconst receipt = await tx.wait(2);  \u002F\u002F 2 confirmations\n\n\u002F\u002F ✅ Nonce management\nclass NonceManager {\n  private pending = new Map\u003CAddress, number>();\n\n  async getNextNonce(address: Address, provider: Provider): Promise\u003Cnumber> {\n    const onChain = await provider.getTransactionCount(address, 'pending');\n    const local = this.pending.get(address) ?? onChain;\n    const next = Math.max(onChain, local);\n    this.pending.set(address, next + 1);\n    return next;\n  }\n}\n```\n\n## Rate Limiting & Retry\n\n```typescript\n\u002F\u002F ✅ Exponential backoff\nasync function fetchWithRetry\u003CT>(fn: () => Promise\u003CT>, maxRetries = 3): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C maxRetries; attempt++) {\n    try {\n      return await fn();\n    } catch (error) {\n      if (error.status === 429) {  \u002F\u002F Rate limited\n        const delay = Math.pow(2, attempt) * 1000;\n        await sleep(delay);\n        continue;\n      }\n      throw error;\n    }\n  }\n  throw new Error('Max retries exceeded');\n}\n\n\u002F\u002F ✅ Fallback RPC endpoints\nconst RPC_ENDPOINTS = [\n  'https:\u002F\u002Feth-mainnet.alchemyapi.io\u002Fv2\u002FKEY',\n  'https:\u002F\u002Fmainnet.infura.io\u002Fv3\u002FKEY',\n  'https:\u002F\u002Frpc.ankr.com\u002Feth',\n];\n```\n\n## Quick Checklist\n\n- [ ] All contract calls wrapped in try\u002Fcatch\n- [ ] Multicall uses `allowFailure: true`\n- [ ] Gas estimation with 20% buffer\n- [ ] EIP-1559 gas pricing used\n- [ ] Transaction simulation before send\n- [ ] Nonce management for concurrent txs\n- [ ] Confirmations appropriate per chain\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fbarissozen\u002Fpitfalls-blockchain",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill pitfalls-blockchain",{"tool":58,"command":59},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill pitfalls-blockchain",{"tool":61,"command":62},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill pitfalls-blockchain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fbarissozen\u002Fpitfalls-blockchain\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"skill-report.json","REFERENCE","参考文档",11371,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fbarissozen\u002Fpitfalls-blockchain\u002Fskill-report.json",[73,87,97,106,112,119],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":83,"publishedAt":38},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[78],{"categoryNo":79,"categoryName":80,"taxonomyType":81,"taxonomyTypeDesc":82},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[84,85,86],"model","model hierarchy","model hierarchy skill",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":93,"publishedAt":38},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[92],{"categoryNo":79,"categoryName":80,"taxonomyType":81,"taxonomyTypeDesc":82},[94,95,96],"MCP","zoom","zoom mcp",{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":38},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[103,104,105,95],"sdk","zoom apps sdk","apps",{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":38},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[108],{"skillNo":113,"name":114,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":118,"publishedAt":38},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[117],{"categoryNo":79,"categoryName":80,"taxonomyType":81,"taxonomyTypeDesc":82},[114],{"skillNo":120,"name":121,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[121]]