{"id":24431755,"url":"https://github.com/silentcicero/wafr","last_synced_at":"2025-04-12T13:21:19.668Z","repository":{"id":66081137,"uuid":"73435313","full_name":"SilentCicero/wafr","owner":"SilentCicero","description":"A super simple Solidity test harness for Ethereum smart-contracts.","archived":false,"fork":false,"pushed_at":"2017-08-24T20:51:14.000Z","size":222,"stargazers_count":31,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T08:01:34.437Z","etag":null,"topics":["contracts","ethereum","mocha","solidity","solidity-contracts","test","test-harness","web3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SilentCicero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-11T01:26:08.000Z","updated_at":"2023-04-24T07:03:25.000Z","dependencies_parsed_at":"2023-02-23T19:30:48.910Z","dependency_job_id":null,"html_url":"https://github.com/SilentCicero/wafr","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":"0.020408163265306145","last_synced_commit":"2c7483feec5df346d8903cab5badc17143c3876d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fwafr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fwafr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fwafr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fwafr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SilentCicero","download_url":"https://codeload.github.com/SilentCicero/wafr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571836,"owners_count":21126522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contracts","ethereum","mocha","solidity","solidity-contracts","test","test-harness","web3"],"created_at":"2025-01-20T15:21:50.015Z","updated_at":"2025-04-12T13:21:19.635Z","avatar_url":"https://github.com/SilentCicero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/SilentCicero/wafr/blob/master/assets/wafr-logo.png\"\u003e\n\n## wafr\n\n\u003cdiv\u003e\n  \u003c!-- Dependency Status --\u003e\n  \u003ca href=\"https://david-dm.org/SilentCicero/wafr\"\u003e\n    \u003cimg src=\"https://david-dm.org/SilentCicero/wafr.svg\"\n    alt=\"Dependency Status\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- devDependency Status --\u003e\n  \u003ca href=\"https://david-dm.org/SilentCicero/wafr#info=devDependencies\"\u003e\n    \u003cimg src=\"https://david-dm.org/SilentCicero/wafr/dev-status.svg\" alt=\"devDependency Status\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- Build Status --\u003e\n  \u003ca href=\"https://travis-ci.org/SilentCicero/wafr\"\u003e\n    \u003cimg src=\"https://travis-ci.org/SilentCicero/wafr.svg\"\n    alt=\"Build Status\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- Test Coverage\n  \u003ca href=\"https://coveralls.io/r/SilentCicero/wafr\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/github/SilentCicero/wafr/badge.svg\" alt=\"Test Coverage\" /\u003e\n  \u003c/a\u003e\n   --\u003e\n\n  \u003c!-- NPM Version --\u003e\n  \u003ca href=\"https://www.npmjs.org/package/wafr\"\u003e\n    \u003cimg src=\"http://img.shields.io/npm/v/wafr.svg\"\n    alt=\"NPM version\" /\u003e\n  \u003c/a\u003e\n\n  \u003c!-- Javascript Style --\u003e\n  \u003ca href=\"http://airbnb.io/javascript/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-airbnb-brightgreen.svg\" alt=\"js-airbnb-style\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\nA super simple, wafer thin, Solidity contract testing harness.\n\n## Install\n\n```\nnpm install -g wafr\n```\n\n## Usage\n\n```\nwafr ./contracts --output ./contracts.json\n```\n\n```\npragma solidity ^0.4.4;\n\nimport \"wafr/Test.sol\";\n\ncontract MyTest is Test {\n  uint firstNumber;\n  uint secondNumber;\n\n  function setup() {\n    firstNumber = 1;\n    secondNumber = 2;\n  }\n\n  function test_basicUnitTest() {\n    assertTrue(firstNumber != secondNumber, \"first should not equal second\");\n  }\n\n  function test_BasicThrow() {\n    if (firstNumber != secondNumber) {\n      throw;\n    }\n  }\n}\n```\n\nNote, run `npm run example` to see [this example](../../blob/master/example) above in action.\n\n## About\n\nWafr was created to serve as a very basic testing harness for Solidity contracts. It simply compiles your contracts, then provides a `Test` class that can be inherited to test various contracts.\n\nWafr acts as a simple testing system. It does very little:\n\n1. Compiles contracts\n2. Deployes any contract with `test` in filename that inherits `wafr/Test.sol`\n3. Sends ether to your Test contract\n4. Runs the `setup` method, if any\n5. Runs any method with `test` in the name\n6. Then tests everything against the `assert` methods\n7. Generates a full report, `--output` your contracts in a `.json` file if desired\n\n## Contributing\n\nPlease help better the ecosystem by submitting issues and pull requests to default. We need all the help we can get to build the absolute best linting standards and utilities. We follow the AirBNB linting standard. Please read more about contributing to `wafr` in the `CONTRIBUTING.md`.\n\n## Guides\n\nYou'll find more detailed information on using default and tailoring it to your needs in our guides:\n\n- [User guide](docs/user-guide.md) - Usage, configuration, FAQ and complementary tools.\n- [Developer guide](docs/developer-guide.md) - Contributing to wafr and writing your own plugins \u0026 formatters.\n\n## Help out\n\nThere is always a lot of work to do, and will have many rules to maintain. So please help out in any way that you can:\n\n- Create, enhance, and debug rules (see our guide to [\"Working on rules\"](CONTRIBUTING.md)).\n- Improve documentation.\n- Chime in on any open issue or pull request.\n- Open new issues about your ideas for making stylelint better, and pull requests to show us how your idea works.\n- Add new tests to *absolutely anything*.\n- Create or contribute to ecosystem tools, like the plugins for Atom and Sublime Text.\n- Spread the word.\n\nPlease consult our [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing](.github/CONTRIBUTING.md) docs before helping out.\n\nWe communicate via [issues](https://github.com/SilentCicero/wafr/issues) and [pull requests](https://github.com/SilentCicero/wafr/pulls).\n\n## Important documents\n\n- [Changelog](CHANGELOG.md)\n- [Contributing Guidelines](.github/CONTRIBUTING.md)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n- [License](https://raw.githubusercontent.com/SilentCicero/wafr/master/LICENSE)\n\n## Licence\n\nThis project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.\n\n```\nThe MIT License\n\nCopyright (c) 2016 Nick Dodson. nickdodson.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentcicero%2Fwafr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilentcicero%2Fwafr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentcicero%2Fwafr/lists"}