Viem Deal Helper

JSON →
library 2.0.4 ·javascript
verified May 27, 2026

viem-deal is a utility library, currently at stable version 2.0.4 (released October 2024), designed to extend viem clients with powerful capabilities for manipulating ERC20 token balances on development and test networks. It enables developers to "deal" arbitrary amounts of any ERC20 token to any account on `setStorageAt`-compatible environments like Anvil, Hardhat, or Tevm-based forks. This functionality mirrors Foundry's `deal` cheat code, achieving balance manipulation by dynamically identifying the correct storage slot for an account's balance using `eth_createAccessList` and then overriding that storage slot's value with `setStorageAt`. The library provides a rapid and efficient method for setting up test scenarios with precise token balances without actual on-chain minting or transfers. The project shows a frequent release cadence, with multiple patch and minor releases in October 2024. A key differentiator is its reliance on RPC cheat codes, which streamlines test setup compared to transactional interactions. The package ships with TypeScript types, ensuring a type-safe development experience.

total hits 15
actors 6 distinct systems
last hit 22h ago human
GPTBot
5
MetaBot
4
Script
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany · 🇸🇬 Singapore