{"bin":{"waffle":"bin/waffle"},"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"c88afb5e9a735af678cf78c6231ceac1e1b35211","tarball":"https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-4.0.7-dev.2d19dde.tgz","fileCount":20,"integrity":"sha512-b+toHauQbOT32ZRkk5E+3kXosePlM8VtkTYSfGJSCw03Luo6SZ3ocoqgyTj6UNqeOsp7UhCzksjmeL6IGcCyQg==","signatures":[{"sig":"MEUCIQD3WLDh3xzx89WTcWZa5YpuQYF42uqyZqW3qILs/8gRLAIgMdUclpQNccZvG5cCuY2FHXicopJYWsYBQjm0jjqSIkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJH3xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3AA/8CVZxCU3209KMdhhFwdue8AF+y5HqV9kr/z+O+lWwKR1+07eb\r\nIn7oLnO+ZA9qoDCGUuqMvNycHbXOr/YqKaoXGUpb04sIaTlbzvxhKv8WBaSd\r\nE6j/brGLpgIu9bRykkS3Y2dHSm2L300Qh3e73Npcv/gmdr7tXYnHcVAWVXlD\r\n1ArpExem/p6Mw3wMegwZW7iW+NsrxNyA2TObwXIJuCvy2fz16fqe+d9g/4At\r\nkbh9oEboAoORVRdyT8aIHC0XqAOH9t8WADugooQFm03I1UCWW30UPMCyZCHQ\r\nm4FAIk1ZBxz+hasH/qSzMj1ReHKNmrlJkmbhDX6j48iMh2SvA5XHtfmLD7T+\r\n2Lsd2QJbuDVv+ckpTlFK8I6aHps9qsZd5HjbJ6dWCoEw0sxPVV8u5G/zguFN\r\nd37D9q4IkASPTyjPYuzxGSJQbPWXneH1XQ9B924nyTSCbt+0KKKDFhmn0vI3\r\nEhjioy51wPPquYrXFUdUofC1R9N0tlZzbX7KpTpfauFQXEcCkzbT3hWUO3tK\r\ngEtE3d2V17if7vs/sQGW9+pi6e7hRmvBWyZj+meOwp5O/rSo3KGp5YIZ50BG\r\nG9eTiQSOdUZX4Xf/81xXSRWlQPMQWjEas+h/qK+Rsxz++wBNZTsJnF7EtFox\r\nl7vTmdk0ecFneWD/H7Jem1fcazFKEC6vMOg=\r\n=E15g\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"ethereum-waffle","_from":"file:ethereum-waffle-4.0.7-dev.2d19dde.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":"code@trusttoken.com"},"homepage":"https://github.com/EthWorks/Waffle","keywords":["ethereum","smart-contracts","solidity","compiler","testing","javascript","typescript","library"],"_resolved":"/tmp/d483ad4273a4c62afad025c8bdc2e76d/ethereum-waffle-4.0.7-dev.2d19dde.tgz","_integrity":"sha512-b+toHauQbOT32ZRkk5E+3kXosePlM8VtkTYSfGJSCw03Luo6SZ3ocoqgyTj6UNqeOsp7UhCzksjmeL6IGcCyQg==","repository":{"url":"git+ssh://git@github.com/EthWorks/Waffle.git","type":"git"},"_npmVersion":"8.15.0","description":"Sweeter, faster and simpler than truffle.","directories":{},"maintainers":[{"name":"ethworks","email":"code@trusttoken.com"}],"_nodeVersion":"16.17.0","dependencies":{"solc":"0.8.15","ethers":"5.6.2","typechain":"^8.0.0","@ethereum-waffle/chai":"4.0.7-dev.2d19dde","@ethereum-waffle/compiler":"4.0.2-dev.2d19dde","@ethereum-waffle/provider":"4.0.4-dev.2d19dde","@ethereum-waffle/mock-contract":"4.0.2-dev.2d19dde"},"publishConfig":{"tag":"dev","access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","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.7-dev.2d19dde_1663335921547_0.34804913646345614","host":"s3://npm-registry-packages"},"_id":"ethereum-waffle@4.0.7-dev.2d19dde","version":"4.0.7-dev.2d19dde"}