{"bin":{"waffle":"bin/waffle"},"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"76a0ae693937483302cb1b1254ce8192b57019cc","tarball":"https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-4.0.0-dev.de3905f.tgz","fileCount":20,"integrity":"sha512-sfIIrEtonoTbxYLPFkpbFUh51mmxo2IkKC+7WFqYQhu/nyP3UfUDheXPEheBQMzAGHr0+Axby3WLiklWd6w34g==","signatures":[{"sig":"MEYCIQDLC/CVHsAo67XiZFkuCAe82AtIUIf5wM6IuKqV5lAQPgIhAIcbDKWAlosw/FK1fCjm00JAbGKwPHJc15lmtGa9QDhO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiaVZzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmou0w/+KvNK++gNet95DtquBI+0HMqBxmR0qrNeC5jdP+TfVxKKiWtO\r\n7q/bxJCGOdd1arNRlPmxNqAVnuk78SUj3hi75i3zZ3BTI/REftEpfbYN++U2\r\n858IO9etaVBzySPXqzuC8NnizERH3EIggjS0RK2SnwNzFs6uZejNt5SMDfFa\r\nZsenmeSO82vFm0xjqLYvXcqmWBZbhbFEnQDHLQyRe+pbVv7+UpgAC7m3yjMi\r\nG11IgrqrKUJISQ8bO8j46szlQv2xjbJ5k1EILzdikbdFFdZz1mbtWQDR3Y5I\r\nQL2QNQj0cqgDFkhBR4wXQrGHBG+tE8ycZqku9k6EgQvRWyGX8X+9xu3d9WWm\r\nB+IkI+/OY1ZPMoWvuoU9lRZBKYutGS2FDyRvudXA7Msdzy2tteh2WXTjnnA+\r\nfImAu6CfDUKHeABpTkAy0BLxbsonKioy+d/T+vsiEyuwOOWpO6wqLnu4tDgm\r\n//zVzZ6MQjnK2kk9Sr8IBm2RrpPlXczjuyhfhlYJ7K58I+1zJIXFpbYMZPLr\r\ncgBMTZAyVYRHSKnYiJOcB39PzdBJWNOrrV4MfAREmaBXnJWuuKb8cq3EMofR\r\nIbegnyYKdl5Gwf015BOpOXpeNfe2vkOJAp5pBImZRYZD7ICQ3tHw5ZqeXQu5\r\n2x01X9YdyZihljyi5WmbyszoYAWgKYR7AgE=\r\n=cm89\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"ethereum-waffle","_from":"file:ethereum-waffle-4.0.0-dev.de3905f.tgz","types":"dist/esm/index.d.ts","author":"Marek Kirejczyk <account@ethworks.io> (http://ethworks.io)","module":"dist/esm/index.ts","readme":"![CI](https://github.com/EthWorks/Waffle/workflows/CI/badge.svg)\n[![](https://img.shields.io/npm/v/ethereum-waffle.svg)](https://www.npmjs.com/package/ethereum-waffle)\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/ppFxC3E44X)\n\n![Ethereum Waffle](https://raw.githubusercontent.com/EthWorks/Waffle/master/docs/source/logo.png)\n\nThe most advanced framework for testing smart contracts.\n\nSweeter, simpler and faster.\n\n## Links\n* Website - https://getwaffle.io/\n* Documentation - https://ethereum-waffle.readthedocs.io/\n\n## Philosophy\n* __Simpler__: Minimalistic, few dependencies.\n* __Sweeter__: Nice syntax, easy to extend.\n* __Faster__: Strong focus on the speed of test execution.\n\n## Features:\n* Sweet set of chai matchers, e.g.:\n  * `expect(...).to.be.revertedWith('Error message')`\n  * `expect(...).to.emit(contract, 'EventName').withArgs(...)`)\n* Importing contracts from npm modules working out of the box, e.g.:\n  * `import \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";`\n* Fixtures that help write fast and maintainable test suites, e.g.:\n  * `const {token} = await loadFixture(standardTokenWithBalance);`\n* Customizable compilation options with native solc, dockerized solc and any version of solc-js loaded remotely at compiled time\n* Mocking smart contracts, e.g.:\n  * `const mockToken = await deployMockContract(wallet, IERC20.abi);`\n* Support for promise-based configuration, e.g.:\n  * use native solc binary for fast compilation in CI environment\n  * use solc-js based on contract versions detected (async)\n* Support for TypeScript\n* Type-safe contract deployment and interactions with TypeChain\n* [Documentation](https://ethereum-waffle.readthedocs.io/en/latest/)\n\n## Documentation\nDocumentation is available [here](https://ethereum-waffle.readthedocs.io/en/latest/).\n\n## Installation:\n\nTo get started install `ethereum-waffle` with yarn:\n```\nyarn add --dev ethereum-waffle\n```\n\nOr if you prefer using npm:\n```\nnpm install --save-dev ethereum-waffle\n```\n\n## Step by step guide\n\n### Add external dependency:\nTo add an external library install it using npm:\n\n```sh\nnpm install @openzeppelin/contracts -D\n```\n\nor with yarn:\n\n```sh\nyarn add @openzeppelin/contracts -D\n```\n\n### Note\n\nFind this example in `examples/basic` and use it.\n\n### Example contract\nBelow is an example contract written in Solidity. Place it in `contracts/BasicToken.sol` file of your project:\n\n```solidity\npragma solidity ^0.6.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\n// Example class - a mock class using delivering from ERC20\ncontract BasicToken is ERC20 {\n    constructor(uint256 initialBalance) ERC20(\"Basic\", \"BSC\") public {\n        _mint(msg.sender, initialBalance);\n    }\n}\n\n```\n\n### Example test\nBelow is an example test written for the contract above compiled with Waffle. Place it under `test/BasicToken.test.ts` file in your project directory:\n\n```ts\nimport {expect, use} from 'chai';\nimport {Contract} from 'ethers';\nimport {deployContract, MockProvider, solidity} from 'ethereum-waffle';\nimport BasicToken from '../build/BasicToken.json';\n\nuse(solidity);\n\ndescribe('BasicToken', () => {\n  const [wallet, walletTo] = new MockProvider().getWallets();\n  let token: Contract;\n\n  beforeEach(async () => {\n    token = await deployContract(wallet, BasicToken, [1000]);\n  });\n\n  it('Assigns initial balance', async () => {\n    expect(await token.balanceOf(wallet.address)).to.equal(1000);\n  });\n\n  it('Transfer adds amount to destination account', async () => {\n    await token.transfer(walletTo.address, 7);\n    expect(await token.balanceOf(walletTo.address)).to.equal(7);\n  });\n\n  it('Transfer emits event', async () => {\n    await expect(token.transfer(walletTo.address, 7))\n      .to.emit(token, 'Transfer')\n      .withArgs(wallet.address, walletTo.address, 7);\n  });\n\n  it('Can not transfer above the amount', async () => {\n    await expect(token.transfer(walletTo.address, 1007)).to.be.reverted;\n  });\n\n  it('Can not transfer from empty account', async () => {\n    const tokenFromOtherWallet = token.connect(walletTo);\n    await expect(tokenFromOtherWallet.transfer(wallet.address, 1))\n      .to.be.reverted;\n  });\n\n  it('Calls totalSupply on BasicToken contract', async () => {\n    await token.totalSupply();\n    expect('totalSupply').to.be.calledOnContract(token);\n  });\n\n  it('Calls balanceOf with sender address on BasicToken contract', async () => {\n    await token.balanceOf(wallet.address);\n    expect('balanceOf').to.be.calledOnContractWith(token, [wallet.address]);\n  });\n});\n```\n\nNote: You will also need to install following dependencies with to run the example above:\n\n```sh\nyarn add mocha -D\nyarn add chai -D\n```\n\nOr with npm:\n\n```\nnpm i chai -D\nnpm i mocha -D\n```\n\n### Compiling\nTo compile your smart contracts run:\n\n```sh\nnpx waffle\n```\n\nTo compile using a custom configuration file run:\n\n```sh\nnpx waffle config.json\n```\n\nExample configuration file looks like this (all fields optional):\n```json\n{\n  \"sourceDirectory\": \"./custom_contracts\",\n  \"outputDirectory\": \"./custom_build\",\n  \"nodeModulesDirectory\": \"./custom_node_modules\"\n}\n```\n\nTo enable generation of [typechain](https://github.com/ethereum-ts/TypeChain) artifacts:\n```json\n{\n  \"typechainEnabled\": true\n}\n```\n\n### Flattener\nTo flat your smart contracts run:\n\n```sh\nnpx waffle flatten\n```\n\nIn configuration file you can add optional field with path to flatten files:\n```json\n{\n  \"flattenOutputDirectory\": \"./custom_flatten\"\n}\n```\n\n\n\n### Running tests\nTo run the tests run the following command:\n\n```sh\nnpx mocha\n```\n\n### Adding an npm script\nFor convinience, you can add the following to your `package.json`:\n```\n{\n  ...,\n  \"scripts\": {\n    \"test\": \"waffle && mocha\"\n  }\n}\n```\n\nNow you can build and test your contracts with one command:\n\n```sh\nnpm test\n```\n\n## Documentation\nFor detailed feature walkthrough checkout [documentation](https://ethereum-waffle.readthedocs.io/en/latest/).\n\n## Contributing\n\nContributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](https://github.com/EthWorks/Waffle/blob/master/CODE_OF_CONDUCT.md) and [contribution policy](https://github.com/EthWorks/Waffle/blob/master/CONTRIBUTION.md).\n\nBefore you issue pull request:\n\nMake sure all tests and linters pass.\nMake sure you have test coverage for any new features.\n\n### Running tests\nNote: To make end-to-end test pass, you need to:\n* have Docker installed, up and running\n* have Ethereum stable docker image pulled, if not run `docker pull ethereum/solc:stable`\n* have native solidity 0.5.* installed\n\nTo run tests type:\n```sh\nyarn test\n```\n\nTo run linter type:\n```sh\nyarn lint\n```\n\n### Building documentation\n\n[Install Sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html) to build documentation:\n\n```sh\ncd docs\nmake html\n```\n\nBefore building documentation for the first time you may have to install required python packages:\n```sh\npip3 install -r docs/requirements.txt\n```\n\n## Roadmap\n\nSee https://github.com/EthWorks/Waffle/issues/155\n\n## License\n\nWaffle is released under the [MIT License](https://opensource.org/licenses/MIT).\n","engines":{"node":">=10.0"},"license":"MIT","private":false,"scripts":{"lint":"eslint '{src,test}/**/*.ts'","test":"yarn test:buildonly && yarn test:nobuild","build":"rimraf ./dist && yarn build:esm && yarn build:cjs","clean":"rimraf ./dist ./test/example/build","lint:fix":"eslint --fix '{src,test}/**/*.ts'","build:cjs":"tsc -p tsconfig.build.json --outDir dist/cjs --declaration false","build:esm":"tsc -p tsconfig.build.json --outDir dist/esm --module ES6","test:nobuild":"mocha","test:buildonly":"ts-node -T buildTestContracts"},"_npmUser":{"name":"ethworks","email":"account@ethworks.io"},"homepage":"https://github.com/EthWorks/Waffle","keywords":["ethereum","smart-contracts","solidity","compiler","testing","javascript","typescript","library"],"_resolved":"/home/runner/work/Waffle/Waffle/waffle-cli/ethereum-waffle-4.0.0-dev.de3905f.tgz","_integrity":"sha512-sfIIrEtonoTbxYLPFkpbFUh51mmxo2IkKC+7WFqYQhu/nyP3UfUDheXPEheBQMzAGHr0+Axby3WLiklWd6w34g==","repository":"git@github.com:EthWorks/Waffle.git","_npmVersion":"8.5.0","description":"Sweeter, faster and simpler than truffle.","directories":{},"maintainers":[{"name":"ethworks","email":"account@ethworks.io"}],"_nodeVersion":"16.14.2","dependencies":{"solc":"^0.6.3","ethers":"5.6.2","typechain":"^8.0.0","@ethereum-waffle/chai":"4.0.0-dev.de3905f","@ethereum-waffle/compiler":"4.0.0-dev.de3905f","@ethereum-waffle/provider":"4.0.0-dev.de3905f","@ethereum-waffle/mock-contract":"4.0.0-dev.de3905f"},"publishConfig":{"tag":"dev","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^8.2.1","eslint":"^7.14.0","rimraf":"^3.0.2","ts-node":"^9.0.0","typescript":"^4.6.2","openzeppelin-solidity":"2.3.0"},"_npmOperationalInternal":{"tmp":"tmp/ethereum-waffle_4.0.0-dev.de3905f_1651070578888_0.8961937937221096","host":"s3://npm-registry-packages"},"_id":"ethereum-waffle@4.0.0-dev.de3905f","version":"4.0.0-dev.de3905f"}