{"id":17604923,"url":"https://github.com/rubilmax/viem-deal","last_synced_at":"2026-03-16T14:08:40.199Z","repository":{"id":257808536,"uuid":"867184601","full_name":"Rubilmax/viem-deal","owner":"Rubilmax","description":"🎩🪄 Easily deal any amount of any ERC20 tokens to any account on any `setStorageAt`-compatible network, using viem!","archived":false,"fork":false,"pushed_at":"2024-10-25T15:18:40.000Z","size":193,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-28T09:12:14.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rubilmax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T15:41:15.000Z","updated_at":"2024-10-25T15:17:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2e44467-5cf9-427c-84b6-71bc969fa541","html_url":"https://github.com/Rubilmax/viem-deal","commit_stats":null,"previous_names":["rubilmax/viem-deal"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rubilmax%2Fviem-deal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rubilmax%2Fviem-deal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rubilmax%2Fviem-deal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rubilmax%2Fviem-deal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rubilmax","download_url":"https://codeload.github.com/Rubilmax/viem-deal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710438,"owners_count":21149188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-22T14:25:02.819Z","updated_at":"2026-03-16T14:08:40.141Z","avatar_url":"https://github.com/Rubilmax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# viem-deal\n\n[![npm package][npm-img]][npm-url]\n[![Build Status][build-img]][build-url]\n[![Downloads][downloads-img]][downloads-url]\n[![Issues][issues-img]][issues-url]\n[![Commitizen Friendly][commitizen-img]][commitizen-url]\n[![Semantic Release][semantic-release-img]][semantic-release-url]\n\nEasily [deal](https://book.getfoundry.sh/cheatcodes/deal) arbitrary amounts of any ERC20 tokens to any account on any `setStorageAt`-compatible network, including in hardhat, tevm, or anvil-based forks!\n\n\u003e NB: `deal` is the name of a cheat code introduced by foundry, which \"mints\" without actually minting ERC20 tokens - it's overriding the storage of the balance of the given recipient\n\nThe storage slot of the mapping `balanceOf` is retrieved via `eth_createAccessList` and the given user's balance is manipulated via `setStorageAt`.\n\n\u003e [!WARNING]  \n\u003e The package is known to have unexpected side effects when used to deal dust of stETH... Be careful!\n\n## Installation\n\n```bash\nnpm install viem-deal\n```\n\n```bash\nyarn add viem-deal\n```\n\n## Usage\n\n### Testing\n\n```typescript\nimport { createTestClient, http } from 'viem';\nimport { foundry } from 'viem/chains';\nimport { dealActions } from 'viem-deal';\n\nconst client = createTestClient({\n  mode: 'anvil',\n  chain: foundry,\n  transport: http(),\n}).extend(dealActions);\n\n// Deal 100 USDC to test address.\nawait client.deal({\n  erc20: \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n  recipient: \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\",\n  amount: parseUnits(\"100\", 6),\n});\n```\n\n\n[build-img]: https://github.com/rubilmax/viem-deal/actions/workflows/release.yml/badge.svg\n[build-url]: https://github.com/rubilmax/viem-deal/actions/workflows/release.yml\n[downloads-img]: https://img.shields.io/npm/dt/viem-deal\n[downloads-url]: https://www.npmtrends.com/viem-deal\n[npm-img]: https://img.shields.io/npm/v/viem-deal\n[npm-url]: https://www.npmjs.com/package/viem-deal\n[issues-img]: https://img.shields.io/github/issues/rubilmax/viem-deal\n[issues-url]: https://github.com/rubilmax/viem-deal/issues\n[codecov-img]: https://codecov.io/gh/rubilmax/viem-deal/branch/main/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/rubilmax/viem-deal\n[semantic-release-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n[commitizen-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[commitizen-url]: http://commitizen.github.io/cz-cli/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubilmax%2Fviem-deal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubilmax%2Fviem-deal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubilmax%2Fviem-deal/lists"}