{"bin":{"waffle":"bin/waffle"},"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"9da90fc7bd8ee6b207a64a44028b2a2f38e05469","tarball":"https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-3.0.0-beta.2.tgz","fileCount":21,"integrity":"sha512-r1suvitDQtl4faGpkHYqPlyxA511tu00dN2J1Py7ieiYGbDOG6FjvfgPTKbzYVAENxANBdtYHNfObxsllkcqKA==","signatures":[{"sig":"MEUCIGUmJqFuAI6eLnW78yD2F8BhxYPlTTunpvW/4HTyHkPEAiEAnloK4ngnme6vabKEPIYMV0QQ/dwiRbaQwPX5+mHpuoI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezA0KCRA9TVsSAnZWagAA4/4P/2B2zADDJOC+B96G1onc\ngYDp1saw8hP5g+V/lnGbzBVQOiM8O+2k4Y/7VK68N1xC/vk8JwtTElWl7T1R\nrD8NLSkP7lOxHgdt0PjksRzi/WFsn4o0KYg+W3QAXIE4XIrGrfMDDtysM42z\nkN8V47QA9m8BJLUE+9L1QRf4aBCaOP7tj/XktB/NbfmbymPwynLWdOkbMaqA\nliCxNBCEcuRvPM3zw4dpl92SW+nZLbn5c+BhWN9GfxGYg2UiVKYHiTGJZqxP\nBPKzRGPaJONNiALCscU8Ljf/BltQIxJ23ZJzMwvIRrjkA2wqMUzzw2dvYyo7\nRQsmifM067K0nSrxDHX6GYQS1UgmeybDZLYFEeZxSuS8pYkrSf/fdGtcGN74\nYZPVxvMAAerdcLLLeyzEH4D6Z1QUs5YyLeuBGjj/+ztWD904zwttHHhG7JP7\npCH+ywGlGxsHG6CXm1yexzsT+1aKJGxrhAJQ8lKwonRlgoI91j36EheHYUFD\nKDil+LY2lll24B0jp7a60i+9yXzV7WfEYa1fGWzX/5ahHBpTqU0bMHvPsqC9\nE+6w4aOX5Gos2Nn/YGMScvrn3Ut08E4/ScWBCHAgNRkUgrr81M/kwmu6am2O\nbmkpssQFZ4wu4RT5na3IR7TWBTu0mikJNVzGVTH+CQUnZa+/oYwDaepcbZsQ\nePIv\r\n=f39U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"ethereum-waffle","types":"dist/esm/index.d.ts","author":{"url":"http://ethworks.io","name":"Marek Kirejczyk","email":"account@ethworks.io"},"module":"dist/esm/index.ts","readme":"[![CircleCI](https://circleci.com/gh/EthWorks/Waffle.svg?style=svg)](https://circleci.com/gh/EthWorks/Waffle)\n[![](https://img.shields.io/npm/v/ethereum-waffle.svg)](https://www.npmjs.com/package/ethereum-waffle)\n\n![Ethereum Waffle](https://raw.githubusercontent.com/EthWorks/Waffle/master/docs/source/logo.png)\n\nLibrary for writing and testing smart contracts.\n\nSweeter, simpler and faster than Truffle.\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* [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 i openzeppelin-solidity -D\n```\n\nor with yarn:\n\n```sh\nyarn add openzeppelin-solidity -D\n```\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\n// contracts/BasicToken.sol\npragma solidity ^0.5.1;\n\nimport \"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\";\n\n// Example class - a mock class using delivering from ERC20\ncontract BasicToken is ERC20 {\n  constructor(address initialAccount, uint256 initialBalance) public {\n    super._mint(initialAccount, initialBalance);\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.js` file of your project:\n\n```js\n// test/BasicToken.js\nconst {use, expect} = require('chai');\nconst {MockProvider, deployContract, solidity} = require('ethereum-waffle');\nconst BasicToken = require('../build/BasicToken');\n\nuse(solidity);\n\ndescribe('BasicToken', () => {\n  const [wallet, walletTo] = new MockProvider().getWallets();\n  let token;\n\n  beforeEach(async () => {\n    token = await deployContract(wallet, BasicToken, [wallet.address, 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\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\nBuilding documentation (requires Sphinx):\n```sh\ncd docs\nmake html\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":"export NODE_ENV=test && mocha","prepublishOnly":"yarn build","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"],"repository":{"url":"git@github.com:EthWorks/Waffle.git","type":"git"},"description":"Sweeter, faster and simpler than truffle.","directories":{},"licenseText":"Copyright 2020 Ethworks sp z o.o.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"ethworks","email":"account@ethworks.io"}],"dependencies":{"ethers":"^5.0.0-beta.184","@ethereum-waffle/chai":"^3.0.0-beta.2","@ethereum-waffle/compiler":"^3.0.0-beta.2","@ethereum-waffle/provider":"^3.0.0-beta.2","@ethereum-waffle/mock-contract":"^3.0.0-beta.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^7.1.2","eslint":"^6.8.0","rimraf":"^3.0.0","ts-node":"^8.9.1","typescript":"^3.8.3","@types/chai":"^4.2.3","@types/mocha":"^5.2.7","chai-as-promised":"^7.1.1","eslint-plugin-import":"^2.20.2","@types/chai-as-promised":"^7.1.2","@typescript-eslint/parser":"^2.30.0","@typescript-eslint/eslint-plugin":"^2.30.0"},"_npmOperationalInternal":{"tmp":"tmp/ethereum-waffle_3.0.0-beta.2_1590430985726_0.8189426497760086","host":"s3://npm-registry-packages"},"_id":"ethereum-waffle@3.0.0-beta.2","version":"3.0.0-beta.2"}