{"bin":{"waffle":"bin/waffle"},"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"249a8c5ede6d9da697b2c5b5602a0311c3e9de93","tarball":"https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-4.0.2-dev.382de5b.tgz","fileCount":20,"integrity":"sha512-oe0DK9EtaN8dmRZR9Udk6MupIcg95aJAcdM9RW5ET2qMQPwejRqhZpMmIib5ZDtiFWRn9B3hbao3KXYUu66FjA==","signatures":[{"sig":"MEYCIQDV/DnVOnEr1E9a6VUTm625qHD8acl8ru5oeY0MLqJZowIhAPKaJ/0bKcstpKzJZMlVtLgdkykQkQX0I2jLPmvMQmSw","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\nwsFzBAEBCAAGBQJi4pyUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcLhAAinJnnIFAd9GWFgFWl6oPbl1kXFxBPjJHExwDDspc5VRnqIHk\r\nDrKuS+DAu5Zuu6LsCNOqtsvrJgJSRrqQTOhnldOZg5ullH2pHW/5d7hTExaB\r\nBNlBC42lwsMpEkWZoq4ctWGE+gOYyELNeoVbLJ86P91gHXrYVREBqMvdbzOu\r\nqUh4O++CDE0Baf/NijU9tw764Kitz36clqjHPkcUY6024EFqlcE2WrzwJCgt\r\nGP+rtVhfZbYSYc9C2PqaLWrkzE6WeHAnsDcgkNzCrMU5aPsoW9Oac92bHX0h\r\njB1P65qe39d6oex7K/gvJhXlPEE9of7GqVFrflZqfokVtvcNTN7lmfnePEqq\r\nm2uPrNZCuyC0pwLvMEJ0giTWaN5HiHOKXYi9sEKUxklMNgVMX4IiP/8TmoHs\r\nX6yZKR357lcGl49D+u0SHQiGLkKhFXQFLVdEGmenoz0cT/9ufgG7FKWBIrll\r\nOba66qHOH4YkeDbxh5QZenWhsAgbmDlG8YcnFxjLhyBsP/wRd6OWp/iNUlbz\r\nvYSRR/cDwwkXh/r9TBQGi1yv1sapRS09J+oPInrEzP910joIpgFpaew7pzz9\r\nOScLPWutClhJolaceGP3GC25iRNZsgmvNDF+eGGoZl/gJSlHC4NNkNkHyscX\r\njcLY3Jj4lr2AG12h5PjhR0yYvEZ7fDWYViU=\r\n=1NnU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"ethereum-waffle","_from":"file:ethereum-waffle-4.0.2-dev.382de5b.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/ed4564aefda6e2e5355e71694f20ebcc/ethereum-waffle-4.0.2-dev.382de5b.tgz","_integrity":"sha512-oe0DK9EtaN8dmRZR9Udk6MupIcg95aJAcdM9RW5ET2qMQPwejRqhZpMmIib5ZDtiFWRn9B3hbao3KXYUu66FjA==","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":"code@trusttoken.com"}],"_nodeVersion":"16.16.0","dependencies":{"solc":"^0.6.3","ethers":"5.6.2","typechain":"^8.0.0","@ethereum-waffle/chai":"4.0.2-dev.382de5b","@ethereum-waffle/compiler":"4.0.1-dev.382de5b","@ethereum-waffle/provider":"4.0.2-dev.382de5b","@ethereum-waffle/mock-contract":"4.0.1-dev.382de5b"},"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.2-dev.382de5b_1659018388593_0.6724546560161164","host":"s3://npm-registry-packages"},"_id":"ethereum-waffle@4.0.2-dev.382de5b","version":"4.0.2-dev.382de5b"}