Urgent.News

What's breaking now, across thousands of outlets.

Tech

What 'Revocable' Actually Means at the Contract Level

If you've ever called approve() on an ERC-20 token and then moved on with your life, you've already brushed up against the thing this post is about: an approval is not a setting inside some app, it's a row in a smart contract's storage, and every system built on top of it is only as honest as its last read of that row. Most token approvals work the same way. A user signs a transaction granting a…

Revocation refers to removing authorization from a user to spend tokens. When a user grants permission, it is recorded as an allowance in the smart contract. To revoke this permission, another transaction must be made, setting the allowance to zero. This transaction is similar to the initial approval, requiring signing, broadcasting, and confirmation like any other.

Many systems rely on a local record of approvals, but this can lead to stale-permissive or stale-restrictive situations where the system's internal record does not match the chain's current state. To avoid problems caused by outdated records, it is necessary to verify the allowance directly from the chain before executing any transaction that would spend the user's tokens.

This ensures that the system's actions align with the latest state of the approval on the blockchain.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

First Action After Compromise: Blind the Audit

✓ Human-authored analysis; AI used for formatting and proofreading. If you're an attacker who's just landed in an AWS account, the most expensive thing about your future is detection.

  • Attackers disable audit trail to evade detection
  • Command used: aws cloudtrail stop-logging
  • Blind window can last several days

A calendar library returned the same answer for every year — and my tests agreed with it

I build a Korean saju (BaZi) service. The whole pitch is that the numbers are computed deterministically and only the prose is written by a model, so the calculation layer is the one part that is not…

  • Calendar library returned same answer for every year
  • Independent astronomical computation provided eleven different results
  • Test suite passed all tests despite incorrect library output

Pull Requests and code review: how to make your code easy to review

I once approved a PR without reading it. Not because I was lazy — because the description was blank, the title was "fix", and the diff had six hundred lines across eleven files with no explanation of…

  • Clear PR title indicates action in imperative mood
  • Description answers why, what, and testing instructions
  • Break down large features into smaller, focused PRs

More from Tuesday 1 September →