The Ridge is a slim, RFID-blocking wallet that's designed to streamline how you carry cash and cards. The Aluminum, Titanium, and Carbon Fiber Options are all guaranteed for life and come with free shipping & returns. See our 10+ Colors. Free 3D Tower defense game. Play regular levels or create your own!
Installation¶
To get started, install ethereum-waffle
:
Add external dependency¶
Add an external library by installing it with yarn or npm:
Writing a contract¶
Below is an example contract written in Solidity. Place it in src/BasicToken.sol
file of your project:
Compiling the contract¶
Add the following entry in the package.json
of your project :
Note
Since Waffle 3.0.0 it recognises waffle.json
as default configuration file. If your configuration file is calledwaffle.json
, it’s possible to use just waffle
to build contracts.
In the waffle.json
file of your project add the following entry:
Then run the following command:
You should see that Waffle compiled your contract and placed the resulting JSONoutput inside the build
directory.
If you want to know more about how to configure Waffle, see Configuration.
Flattener¶
To flat your smart contracts run:
In configuration file you can add optional field with path to flatten files:
Writing tests¶
After you have successfully authored a Smart Contract you can now think abouttesting it. Fortunately for you, Waffle is packed with tools that help with that.
Tests in waffle are written using Mocha alongside withChai. You can use a different test environment,but Waffle matchers only work with chai
.
Run:
Waffle Tower Defense (vgdc) Mac Os X
Note
If you are using Typescript don’t forget to add ts-node
and typescript
to your devDependencies
. Also, make sure to add a tsconfig.json
, and within it, set 'esModuleInterop'
and 'resolveJsonModule'
to true
. Lastly, instead of using mocha
in your Node scripts within your package.json
, replace it with ts-node
.
Below is an example test file for the contract above written with Waffle. Place it under test/BasicToken.test.ts
file in your project directory:
Running tests¶
Waffle Tower Defense (vgdc) Mac Os Update
Update your package.json
file to include:
If you are using TypeScript add mocha.opts
file in your test folder:
And run:
You should see the following output:
If you want to know more about testing with Waffle, see Basic testing.