Waffle: Deploy a Smart Contract with Waffle That’s Stored on IPFS
Learn how to deploy a smart contract with Waffle that's stored on IPFS.
What is Waffle?
1. First, we need a Filebase IPFS bucket.
2. Select ‘Buckets’ from the left side bar menu, or navigate to console.filebase.com/buckets.

3. Enter a bucket name and choose the IPFS storage network to create the bucket.

4. Next, download and install S3FS-FUSE on a Linux or macOS system.
5. Open a terminal window. Then, set up an Access Key file for use with S3FS-FUSE.
6. Mount your bucket.
7. Now, navigate into the mounted Filebase bucket.
8. Create a new folder for your project, then navigate inside that folder:
9. Next, install the ethereum-waffle package:
ethereum-waffle package:10. Install the OpenZeppelin package, we’ll be using this for our smart contract functionality:
11. Make a new directory called src, then create a new file called BasicToken.sol. Open this file in your IDE, and insert the following content:
src, then create a new file called BasicToken.sol. Open this file in your IDE, and insert the following content:12. Then, at the root of your project, create a new file called package.json. Insert the following content:
package.json. Insert the following content:13. Create another new file called waffle.json that contains the following content:
waffle.json that contains the following content:14. Create new directories called build and contracts at the root of your project, since they are used in the waffle.json file.
build and contracts at the root of your project, since they are used in the waffle.json file.15. Then build the project with the command:
16. Now it’s time to test the smart contract. Run the following command to install Chai to be used for a test environment:
17. Make another new directory in the root of your project called test, then create a new file called BasicToken.test.ts in this directory. Open this new file in your IDE, and insert the following content:
test, then create a new file called BasicToken.test.ts in this directory. Open this new file in your IDE, and insert the following content:18. Open your package.json file and insert the following content:
.json file and insert the following content:19. Then, add a new file called .mocharc.json in the root of your project:
.mocharc.json in the root of your project:20. Then, run your test with:
Last updated