{"_id":"@defi-wonderland/foundry-mock-generator","_rev":"8-a995f94ee1345dd592f7b24f151c1a31","name":"@defi-wonderland/foundry-mock-generator","dist-tags":{"canary":"0.0.0-a1bc279d","latest":"1.0.2"},"versions":{"0.0.0-78cf0785":{"name":"@defi-wonderland/foundry-mock-generator","version":"0.0.0-78cf0785","author":{"name":"Wonderland"},"license":"AGPL-3.0","_id":"@defi-wonderland/foundry-mock-generator@0.0.0-78cf0785","maintainers":[{"name":"wonderland-bot","email":"wonderland@defi.sucks"},{"name":"gas1cent","email":"gas1cent@defi.sucks"},{"name":"0xng","email":"ng@defi.sucks"},{"name":"0xgorilla","email":"0xGorilla@defi.sucks"},{"name":"kelvinfichter","email":"kelvinfichter@gmail.com"},{"name":"wei3erhase","email":"wei3erhase@defi.sucks"},{"name":"enderman0x","email":"enderman0x@defi.sucks"}],"homepage":"https://github.com/defi-wonderland/mock-foundry#readme","bugs":{"url":"https://github.com/defi-wonderland/mock-foundry-private/issues"},"bin":{"foundry-mock-generator":"dist/run.js"},"dist":{"shasum":"ca180df464fdc3b7c06cb8083ba69a07dd80d55e","tarball":"https://registry.npmjs.org/@defi-wonderland/foundry-mock-generator/-/foundry-mock-generator-0.0.0-78cf0785.tgz","fileCount":37,"integrity":"sha512-cpuyYARgalGGFppzK8N2qv5C205tpVtGnognjzQNk1UOS7CFiOvj3KWqo32s/vdnzdycx3tldKk/dZeTyo3xnA==","signatures":[{"sig":"MEUCIQDKjS6nMOXWRbyEItBbu3nQZUiOFU6IdW1HHoFC6odxawIgKVAc0heC6qdDM4Lkv0mBB+UELn8tnDVdXAf04NdIsXU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59592},"main":"dist/run.js","types":"dist/run.d.ts","gitHead":"78cf0785d8e194804c35dcacdb03e2a4eada10cc","scripts":{"test":"forge build --skip test && cross-env mocha 'test/**/*.spec.ts' && forge test","build":"rm -rf dist && tsc -p tsconfig.json && node copy-templates.js","release":"yarn build && yarn changeset publish","lint:fix":"sort-package-json && forge fmt && yarn lint:ts-logic --fix","mock-gen":"ts-node src/run.ts mock-gen","lint:check":"yarn lint:ts-logic && forge fmt check","test:mocha":"cross-env mocha 'test/**/*.spec.ts'","lint:ts-logic":"eslint ./src/**/*.ts"},"_npmUser":{"name":"wonderland-bot","email":"wonderland@defi.sucks"},"repository":{"url":"git+https://github.com/defi-wonderland/mock-foundry-private.git","type":"git"},"_npmVersion":"8.19.4","description":"A mock contract generator for Foundry","directories":{},"lint-staged":{"*.ts":"eslint ./src/**/*.ts","package.json":"sort-package-json","*.{js,css,md,ts,sol}":"forge fmt"},"_nodeVersion":"16.20.2","dependencies":{"yargs":"17.7.2","handlebars":"4.7.7","@defi-wonderland/solidity-utils":"0.0.0-4298c6c6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","husky":"8.0.3","mocha":"10.2.0","sinon":"15.1.0","eslint":"8.40.0","nodemon":"2.0.22","ts-node":"10.9.1","cross-env":"7.0.3","typescript":"5.0.4","@types/chai":"4.3.5","@types/node":"20.2.3","lint-staged":"10","@types/mocha":"10.0.1","@types/yargs":"^17.0.24","tsconfig-paths":"4.2.0","@changesets/cli":"^2.26.1","@commitlint/cli":"17.0.3","@types/fs-extra":"11.0.1","chai-as-promised":"7.1.1","sort-package-json":"2.4.1","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.6","@commitlint/config-conventional":"17.0.3","@typescript-eslint/eslint-plugin":"5.59.6"},"_npmOperationalInternal":{"tmp":"tmp/foundry-mock-generator_0.0.0-78cf0785_1698066612862_0.8561813188235459","host":"s3://npm-registry-packages"}},"0.0.0-a1bc279d":{"name":"@defi-wonderland/foundry-mock-generator","version":"0.0.0-a1bc279d","author":{"name":"Wonderland"},"license":"AGPL-3.0","_id":"@defi-wonderland/foundry-mock-generator@0.0.0-a1bc279d","maintainers":[{"name":"wonderland-bot","email":"wonderland@defi.sucks"},{"name":"gas1cent","email":"gas1cent@defi.sucks"},{"name":"0xng","email":"ng@defi.sucks"},{"name":"0xgorilla","email":"0xGorilla@defi.sucks"},{"name":"kelvinfichter","email":"kelvinfichter@gmail.com"},{"name":"wei3erhase","email":"wei3erhase@defi.sucks"},{"name":"enderman0x","email":"enderman0x@defi.sucks"}],"homepage":"https://github.com/defi-wonderland/mock-foundry#readme","bugs":{"url":"https://github.com/defi-wonderland/mock-foundry-private/issues"},"bin":{"foundry-mock-generator":"dist/run.js"},"dist":{"shasum":"b5ad87d42552c6d4db4a85aaa0fd5864b929572d","tarball":"https://registry.npmjs.org/@defi-wonderland/foundry-mock-generator/-/foundry-mock-generator-0.0.0-a1bc279d.tgz","fileCount":38,"integrity":"sha512-VQjGg3UwI4auEph4wxgZOUgBOH4Q//WPAlyYtlBQ/etzKYl/VgxTiBqcggmXpLoJpon2+Z9WwWTdn8aMejEarA==","signatures":[{"sig":"MEUCIQCS+z9tCHrQFpjO0qCo/UciPHMwlzWL3LLgQ4aOO5WIYQIgG7GD6XJiUxDO4O+NXE4BWhNw2LkBTTNQKKS7nP+HvHc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60165},"main":"dist/run.js","types":"dist/run.d.ts","readme":"**Foundry Mock Generator** is the solidity **mock**ing library. It's a plugin for\n[foundry](https://github.com/foundry-rs/foundry) that can be used to create mock Solidity\ncontracts able to mock variables and external calls.\n\n# Features\n\n- Get rid of your folder of \"mock\" contracts and **just use\n  foundry**.\n- Keep your tests **simple** with a easy mock functions.\n- Mock up external calls and variables in a beautiful and orderly fashion.\n\n## Installation\n\nYou can install the tool via yarn:\n\n```bash\nyarn add foundry-mock-generator@<latest-canary>\n```\n\n## Basic Usage\n\nTo generate the mock contracts all you have to do is run:\n\n```bash\nyarn foundry-mock-generator --contracts <path/to/contracts> --out <path/to/foundry/out> --genDir <path/to/generate/contracts>\n```\n\nNote: --contracts required by the user, tha path to the solidity contracts to mock\nNote: --genDir default path is `solidity/test/mock-contracts`, the path to generate the mock contracts\nNote: --out default path is `out`, the path that has foundry's compiled artifacts\n\n1. To use the mock contracts in your tests just import them\n\n```JavaScript\nimport { MockMyContractName } from '/path/to/mock-contracts/MockMyContractName.sol'\n```\n\n2. Create the mock contract and allow cheatcodes for it\n\n```JavaScript\n/// Deploy mock contract\nmock_myContract = new MockMyContractname(...);\n/// Allow mocks for the contract\nvm.allowCheatcodes(address(mock_myContract));\n```\n\n3. Enjoy of easy mock calls\n```JavaScript\n/// Mock myFuncName function, when called with `arg1`, `arg2` to return `return1`\nmock_myContract.mock_call_myFuncName(arg1, arg2, return1);\n/// Mock myVarName variable, to return `return1`\nmock_myContract.mock_call_myVarName(return1);\n```\n\n4. You also can change value of any variable (except of `private`)\n\n```JavaScript\n/// Change value of a variable\nmock_myContract.set_myVarName(value);\n```\n\n- Please, note that if you want to mock `internal` functions, you **must** make them `virtual`. The tool will not generate mocks for internal functions that are not virtual.\n\n## Release\n\nWe use changesets to mark packages for new releases. When merging commits to the dev branch you MUST include a changeset file if your change would require that a new version of a package be released.\n\nTo add a changeset, run the command `yarn changeset` in the root of this repo. You will be presented with a small prompt to select the packages to be released, the scope of the release (major, minor, or patch), and the reason for the release. Comments within changeset files will be automatically included in the changelog of the package.\n\n# Contributors\n\nMaintained with love by [Wonderland](https://defi.sucks). Made possible by viewers like you.\n","gitHead":"a1bc279df0e53b1a3f2bd5c64a19952427e75010","scripts":{"test":"forge build --skip test && cross-env mocha 'test/**/*.spec.ts' && forge test","build":"rm -rf dist && tsc -p tsconfig.json && node copy-templates.js","release":"yarn build && yarn changeset publish","lint:fix":"sort-package-json && forge fmt && yarn lint:ts-logic --fix","mock-gen":"ts-node src/run.ts mock-gen","lint:check":"yarn lint:ts-logic && forge fmt check","test:mocha":"cross-env mocha 'test/**/*.spec.ts'","lint:ts-logic":"eslint ./src/**/*.ts"},"_npmUser":{"name":"wonderland-bot","email":"wonderland@defi.sucks"},"repository":{"url":"git+https://github.com/defi-wonderland/mock-foundry-private.git","type":"git"},"_npmVersion":"8.19.4","description":"A mock contract generator for Foundry","directories":{},"lint-staged":{"*.ts":"eslint ./src/**/*.ts","package.json":"sort-package-json","*.{js,css,md,ts,sol}":"forge fmt"},"_nodeVersion":"16.20.2","dependencies":{"yargs":"17.7.2","handlebars":"4.7.7","@defi-wonderland/solidity-utils":"0.0.0-4298c6c6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.3.7","husky":"8.0.3","mocha":"10.2.0","sinon":"15.1.0","eslint":"8.40.0","nodemon":"2.0.22","ts-node":"10.9.1","cross-env":"7.0.3","typescript":"5.0.4","@types/chai":"4.3.5","@types/node":"20.2.3","lint-staged":"10","@types/mocha":"10.0.1","@types/yargs":"^17.0.24","tsconfig-paths":"4.2.0","@changesets/cli":"^2.26.1","@commitlint/cli":"17.0.3","@types/fs-extra":"11.0.1","chai-as-promised":"7.1.1","sort-package-json":"2.4.1","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.6","@commitlint/config-conventional":"17.0.3","@typescript-eslint/eslint-plugin":"5.59.6"},"_npmOperationalInternal":{"tmp":"tmp/foundry-mock-generator_0.0.0-a1bc279d_1698066937084_0.9748845355955653","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@defi-wonderland/foundry-mock-generator","version":"1.0.2","author":{"name":"Wonderland"},"license":"AGPL-3.0","_id":"@defi-wonderland/foundry-mock-generator@1.0.2","maintainers":[{"name":"wonderland-bot","email":"wonderland@defi.sucks"},{"name":"gas1cent","email":"gas1cent@defi.sucks"},{"name":"0xng","email":"ng@defi.sucks"},{"name":"0xgorilla","email":"0xGorilla@defi.sucks"},{"name":"kelvinfichter","email":"kelvinfichter@gmail.com"},{"name":"wei3erhase","email":"wei3erhase@defi.sucks"},{"name":"enderman0x","email":"enderman0x@defi.sucks"}],"homepage":"https://github.com/defi-wonderland/mock-foundry#readme","bugs":{"url":"https://github.com/defi-wonderland/mock-foundry-private/issues"},"bin":{"foundry-mock-generator":"dist/run.js"},"dist":{"shasum":"9a52a2cc6c8819396d444973348029ada6af7212","tarball":"https://registry.npmjs.org/@defi-wonderland/foundry-mock-generator/-/foundry-mock-generator-1.0.2.tgz","fileCount":38,"integrity":"sha512-vWFChozODGnGvld6LqvtTMaZVB9xF+BTgDMwXiuINgYSyCSQbY7NHloIgLNh3kAs5IMsFEUt/Gy2P7PBUryDiw==","signatures":[{"sig":"MEUCIDWv5zElxI3vjxEVm3mnSM1smccyxLa2MGHf02KbNQZwAiEA4LdpHU6Nej+S6E8flPN585F64LDYUVsFdBIwjbhvWU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60130},"main":"dist/run.js","types":"dist/run.d.ts","gitHead":"c0116f57eef723c44c25c34ba6d9424d2d91d6ad","scripts":{"test":"forge build --skip test && cross-env mocha 'test/**/*.spec.ts' && forge test","build":"rm -rf dist && tsc -p tsconfig.json && node copy-templates.js","release":"yarn build && yarn changeset publish","lint:fix":"sort-package-json && forge fmt && yarn lint:ts-logic --fix","mock-gen":"ts-node src/run.ts mock-gen","lint:check":"yarn lint:ts-logic && forge fmt check","test:mocha":"cross-env mocha 'test/**/*.spec.ts'","lint:ts-logic":"eslint ./src/**/*.ts"},"_npmUser":{"name":"wonderland-bot","email":"wonderland@defi.sucks"},"repository":{"url":"git+https://github.com/defi-wonderland/mock-foundry-private.git","type":"git"},"_npmVersion":"8.19.4","description":"A mock contract generator for Foundry","directories":{},"lint-staged":{"*.ts":"eslint ./src/**/*.ts","package.json":"sort-package-json","*.{js,css,md,ts,sol}":"forge fmt"},"_nodeVersion":"16.20.2","dependencies":{"yargs":"17.7.2","handlebars":"4.7.7","@defi-wonderland/solidity-utils":"0.0.0-4298c6c6"},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.3.7","husky":"8.0.3","mocha":"10.2.0","sinon":"15.1.0","eslint":"8.40.0","nodemon":"2.0.22","ts-node":"10.9.1","cross-env":"7.0.3","typescript":"5.0.4","@types/chai":"4.3.5","@types/node":"20.2.3","lint-staged":"10","@types/mocha":"10.0.1","@types/yargs":"^17.0.24","tsconfig-paths":"4.2.0","@changesets/cli":"^2.26.1","@commitlint/cli":"17.0.3","@types/fs-extra":"11.0.1","chai-as-promised":"7.1.1","sort-package-json":"2.4.1","@types/chai-as-promised":"7.1.5","@typescript-eslint/parser":"5.59.6","@commitlint/config-conventional":"17.0.3","@typescript-eslint/eslint-plugin":"5.59.6"},"_npmOperationalInternal":{"tmp":"tmp/foundry-mock-generator_1.0.2_1698174475264_0.6534797911450374","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-10-23T13:10:12.771Z","modified":"2025-07-25T08:28:18.024Z","0.0.0-78cf0785":"2023-10-23T13:10:13.122Z","0.0.0-a1bc279d":"2023-10-23T13:15:37.451Z","1.0.2":"2023-10-24T19:07:55.569Z"},"bugs":{"url":"https://github.com/defi-wonderland/mock-foundry-private/issues"},"author":{"name":"Wonderland"},"license":"AGPL-3.0","homepage":"https://github.com/defi-wonderland/mock-foundry#readme","repository":{"url":"git+https://github.com/defi-wonderland/mock-foundry-private.git","type":"git"},"description":"A mock contract generator for Foundry","maintainers":[{"email":"gori@wonderland.xyz","name":"0xgorilla"},{"email":"alice@wonderland.xyz","name":"wonderland-bot"},{"email":"turtlemoji@protonmail.com","name":"turtlemoji"}],"readme":"**Foundry Mock Generator** is the solidity **mock**ing library. It's a plugin for\n[foundry](https://github.com/foundry-rs/foundry) that can be used to create mock Solidity\ncontracts able to mock variables and external calls.\n\n# Features\n\n- Get rid of your folder of \"mock\" contracts and **just use\n  foundry**.\n- Keep your tests **simple** with a easy mock functions.\n- Mock up external calls and variables in a beautiful and orderly fashion.\n\n## Installation\n\nYou can install the tool via yarn:\n\n```bash\nyarn add foundry-mock-generator@<latest-canary>\n```\n\n## Basic Usage\n\nTo generate the mock contracts all you have to do is run:\n\n```bash\nyarn foundry-mock-generator --contracts <path/to/contracts> --out <path/to/foundry/out> --genDir <path/to/generate/contracts>\n```\n\nNote: --contracts required by the user, tha path to the solidity contracts to mock\nNote: --genDir default path is `solidity/test/mock-contracts`, the path to generate the mock contracts\nNote: --out default path is `out`, the path that has foundry's compiled artifacts\n\n1. To use the mock contracts in your tests just import them\n\n```JavaScript\nimport { MockMyContractName } from '/path/to/mock-contracts/MockMyContractName.sol'\n```\n\n2. Create the mock contract and allow cheatcodes for it\n\n```JavaScript\n/// Deploy mock contract\nmock_myContract = new MockMyContractname(...);\n/// Allow mocks for the contract\nvm.allowCheatcodes(address(mock_myContract));\n```\n\n3. Enjoy of easy mock calls\n```JavaScript\n/// Mock myFuncName function, when called with `arg1`, `arg2` to return `return1`\nmock_myContract.mock_call_myFuncName(arg1, arg2, return1);\n/// Mock myVarName variable, to return `return1`\nmock_myContract.mock_call_myVarName(return1);\n```\n\n4. You also can change value of any variable (except of `private`)\n\n```JavaScript\n/// Change value of a variable\nmock_myContract.set_myVarName(value);\n```\n\n- Please, note that if you want to mock `internal` functions, you **must** make them `virtual`. The tool will not generate mocks for internal functions that are not virtual.\n\n## Release\n\nWe use changesets to mark packages for new releases. When merging commits to the dev branch you MUST include a changeset file if your change would require that a new version of a package be released.\n\nTo add a changeset, run the command `yarn changeset` in the root of this repo. You will be presented with a small prompt to select the packages to be released, the scope of the release (major, minor, or patch), and the reason for the release. Comments within changeset files will be automatically included in the changelog of the package.\n\n# Contributors\n\nMaintained with love by [Wonderland](https://defi.sucks). Made possible by viewers like you.\n","readmeFilename":"README.md"}