{"bin":{"waffle":"bin/waffle"},"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"48780a4d31df8fbd73bbb7f27a3ca34aa13dbaf2","tarball":"https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-4.0.0-dev.4fd670d.tgz","fileCount":20,"integrity":"sha512-m3SEJ7tPoBnnVu+VpuRv5MdpToalyhpxIVN+2ZLwzreOgALCxMJpMsKl6aCw7ac+p3ZlmaXVyqU0ffvzLYlOvQ==","signatures":[{"sig":"MEUCIQC5h3pz1amqJZfjEKWxzMixgxJqYqyVp6TNzW65AOOWswIgC81ZEYhws+ERwkPq+0gZD0ABWStezfKSx5e6KjarksY=","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\nwsFzBAEBCAAGBQJinzYUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqkog//VFvFFxfpj6g6jc8iGbhC0XVs5WXG3Z+NaVNNEGQm4YnxadZv\r\nU+omJ6kvrpo8qCzu/yL+F7SFkzNzAbeYk4EWcFpFtnlH0CmyNwcbzk/aF85G\r\nk5RQRmP3jWzlm3ukDCrdGyZjcO4G4OXFJhLK2SUH+uzgYS/Olig6YGAdGGIi\r\n2NKwcNBxH+AySANircPsCJUpvZD7sgG4MpWLQcVLTMtaFxaiXFIcd8wQdWeL\r\ngn9F6YJBcVfdi1aINEtMzPoN7LnVnS+CYaDx2ZqcUlDOUrsZ2zgHUxdSAQon\r\nf9O3rVU3Sg+ieGpu1C0bx5REB+dDdQQArtkrMHJy++HV1ij5YmY5cOMCi/Cy\r\n7K2n0rAOBcwmfuAoxZHhp0PZBncSCXh7waVARG+YiKtvmjrJiE9v8Gfr3w+o\r\nzA5ThycBfa7Ib1c4AngK2TiTTkEm5Y3TQhtbN89nfYfdiI0+MUxHVudeKUXV\r\n2RaWpY4RHLi3FGY9QhonhKLmEF14p6g6Z087na7i4O/X+koUo4kKzgx67IpP\r\nfOQIMmtz3ekHqDxsqeQgOmJz3Pk12aTMR6oa3VaIleSwuSEtV+uUoUj3ppLC\r\nO+EizLrrVoMaEL+lGHsYPcwyXgwcyFjTUQEoPtjoIEEy17gi7lzRXRbOIDpT\r\nkekqr51B/xT07r5LN8XB+hBS439torDi9bA=\r\n=UT8q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"ethereum-waffle","_from":"file:ethereum-waffle-4.0.0-dev.4fd670d.tgz","types":"dist/esm/index.d.ts","author":{"url":"http://ethworks.io","name":"Marek Kirejczyk","email":"account@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.4fd670d.tgz","_integrity":"sha512-m3SEJ7tPoBnnVu+VpuRv5MdpToalyhpxIVN+2ZLwzreOgALCxMJpMsKl6aCw7ac+p3ZlmaXVyqU0ffvzLYlOvQ==","repository":{"url":"git+ssh://git@github.com/EthWorks/Waffle.git","type":"git"},"_npmVersion":"8.11.0","description":"Sweeter, faster and simpler than truffle.","directories":{},"maintainers":[{"name":"ethworks","email":"account@ethworks.io"}],"_nodeVersion":"16.15.1","dependencies":{"solc":"^0.6.3","ethers":"5.6.2","typechain":"^8.0.0","@ethereum-waffle/chai":"4.0.0-dev.4fd670d","@ethereum-waffle/compiler":"4.0.0-dev.4fd670d","@ethereum-waffle/provider":"4.0.0-dev.4fd670d","@ethereum-waffle/mock-contract":"4.0.0-dev.4fd670d"},"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.4fd670d_1654601236602_0.11436441802261199","host":"s3://npm-registry-packages"},"_id":"ethereum-waffle@4.0.0-dev.4fd670d","version":"4.0.0-dev.4fd670d"}