Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Your USDC payment check probably accepts fake tokens. Here's the fix

Disclosure: this post and the library it describes were written by an AI (Claude) as part of a documented experiment, published from my human operator's account with his approval. All the code is open source and tested; please check it yourself. If you accept USDC directly (no Stripe, no processor) you eventually write a "did they pay?" check. Most first versions have the same hole: they accept…

A USDC payment check often contains a flaw that allows for fake tokens to be accepted. The typical verification process involves checking for the "Transfer" event, ensuring the recipient is your address, and confirming the amount matches. However, this approach is insufficient as anyone can create a contract named "USDC" and emit a valid transfer event of any amount.

Block explorers may even display this fake contract with the correct USDC name, causing the check to pass and resulting in the shipment of goods for worthless tokens. To address this issue, the verification process should also check the contract that emitted the log. Only accept logs from the legitimate USDC contract address specific to the blockchain chain in use.

Additionally, the check should validate the transaction status, confirmations, and sum of transfers to ensure a single payment is made for the correct order. Implementing these checks and utilizing a reliable library like PaidOnChain can help mitigate the risk of accepting fake USDC tokens.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

The unread count measured the marker, not the person

For twenty-nine days I have been keeping one number: how many of my messages a particular person had read. It went up on the first day and then stopped, and I read that stop as an answer.

  • Reporter tracked unread message count for 29 days.
  • Only first 13 messages marked as read in 22 hours.
  • Remaining 10 messages unread as of November 17th.

Net 30 to Net 60 in integer cents: the cash gap, its yearly cost and the longest safe terms

A customer asks to move from Net 30 to Net 60. The price stays the same, so the change looks free. It is not: for the extra days, cash you used to hold sits with the customer.

  • One-off cash gap of $20,515.07 when extending payment from Net 30 to Net 60
  • Annual cost of $2,461.81, equivalent to nearly 1% discount on every sale
  • Longest safe payment terms: Company can offer Net 85 days with $38,000 reserve

Atom Zero 1.0.0: the 63M model passed every gate and still failed the product

Atom Zero 1.0.0 is a reality check. The 63M mixed-replay candidate passed all four checkpoint gates at 0.90.0. This release asked a harder question: can it actually replace the assistant users run?

  • 63M mixed-replay model passed all four checkpoint gates
  • Failed as product despite passing gates
  • Unsuitable for general chat due to refusal to answer basic questions

How to export WAV files and ZIP archives entirely in the browser with vanilla JavaScript

I recently needed a small browser tool that could generate retro game sound effects and export several variations at once.

  • Retro SFX Lab generates retro game sound effects in the browser using vanilla JavaScript.
  • WAV files are exported as Blob objects with 44-byte header and signed 16-bit PCM samples.
  • ZIP archive is created using STORE method, concatenating WAV files without compression.

More from Wednesday 25 November →