onlink

Local code and the on-chain code it talks to, in one window.

onlink is a Mac app for smart-contract audits. Paste an address and it fetches the verified source, follows the proxy to the code that actually runs, and keeps it cached for offline work.

Download for Mac

Version 0.1.2, for macOS 14 or later on Apple Silicon.

Paste into your coding agent

onlink is a Mac app for smart-contract auditors. It shows therepository under review next to the deployed contracts it calls, sothe auditor reads local code and on-chain code in one window.Its CLI lets you prepare that for them: put the local code and everyon-chain contract of the audit into one workspace, and open any ofthose files at a line in their app.Install the CLI (macOS, Apple Silicon):  mkdir -p ~/.local/bin  curl -fsSL https://github.com/lxhyl/onlink/releases/latest/download/onlink-cli-macos-arm64.tar.gz | tar -xz -C ~/.local/bin  ~/.local/bin/onlink --versionThe auditor downloads the app from https://onlink.ozlab.xyzWhat it does:- Workspace: one .onlink.json per audit lists the local code, the  on-chain addresses and any reference code. The app opens it as one  window.- Verified source for an address on any EVM chain, from Sourcify,  Etherscan, Blockscout and Routescan, best match first. An explorer  link works in place of an address.- Proxies are resolved on-chain (EIP-1967, UUPS, beacons, EIP-1167  clones, Safe, EIP-7702, diamonds, selector routers). A proxy comes  with the implementation behind it and its upgrade history.- Opens code in the app: a local file or a file of an on-chain  contract, at a line.- Sources are cached in ~/.onlink, so a workspace works offline and  you can read the same files from disk.- Every command takes --json. Run onlink --help for the commands.
onlink showing a workspace: local files and on-chain contracts in the sidebar, the implementation of a proxy open in the editor

What it does

One sidebar for every source

Your repository, each on-chain contract and reference code side by side. A proxy opens straight onto its implementation. One project per window.

Verified source from four explorers

Sourcify, Etherscan, Blockscout and Routescan, tried in order per chain and ranked by match quality. Paste an address or an explorer link.

Proxies resolved on-chain

EIP-1967, UUPS, beacons, EIP-1167 clones, Safe, EIP-7702, diamonds and selector routers, read from the chain itself, with upgrade history and alerts when an implementation changes.

Works offline

Everything is cached in ~/.onlink, keyed by codehash.

Search and go to definition

Search the whole workspace, quick-open any file, and ⌘-click from an interface to the deployed contract it's bound to.

Works with your coding agent

The same core as a CLI, with --json on every command. An agent can put the audit's local and on-chain code into the workspace, and onlink open jumps the app to a line.

Chains