How it works
Locksmith is a Chrome extension that sits between your wallet and Uniswap. When you make a profitable sell, it locks a portion of your proceeds into a time-locked on-chain vault — before you can spend them.
Swap interception
The extension injects a script into every page running in the Ethereum provider context. That script wraps window.ethereum.request so it can observe outgoing transactions before they reach the wallet.
When you initiate a sell on Uniswap, the extension inspects the calldata. It parses Universal Router commands — V2, V3, and V4 — to determine what you're selling, what you're receiving, and which path the swap is routing through. If the parsed output matches an open position in your cost basis ledger, the extension knows you're taking profit.
You're shown an overlay: the estimated proceeds, the calculated profit (proceeds minus cost basis), and a prompt to lock. If you click Lock, the sell goes through normally. If you close it, nothing changes.
Profit calculation
Cost basis is tracked per position: chainId:walletAddress:tokenAddress. When you buy a token, the extension records the ETH spent. When you sell, it computes:
profit = proceedsETH - costBasisETHThe cost basis is stored locally in the extension. It resets when you claim a vault deposit, starting a new cycle.
Deposit flow
When you confirm a lock, the extension waits for the sell transaction to be mined and confirmed before doing anything. It polls the RPC for the receipt at 500ms intervals. If the transaction reverts, no deposit is triggered. If it confirms with status: 1, the extension reads the actual on-chain proceeds from the receipt and prompts your wallet to call depositProfit() on your vault contract.
The deposit is a separate transaction you sign explicitly. Locksmith cannot move funds without your wallet signature.
What happens on-chain
depositProfit(uint256 _discount) is called on your personal vault contract. The contract:
- Deducts a 0.5% service fee, sent to the protocol fee recipient
- Locks the remainder for your configured duration, minus any tier discount
- Emits a
Depositedevent
The locked ETH cannot be withdrawn until the lock expires. Early release is possible but costs 15% of the locked amount.