Deploying Smart Contracts on Mazze Testnet

This guide will walk you through deploying, testing and interacting with your smart contracts on the Mazze Testnet. Since Mazze is EVM-compatible, you can use familiar Ethereum tools like Truffle, Hardhat, or Remix for your development process.

Prerequisites

  • Ensure your Metamask is configured for the Mazze Testnet. See our guide on How to Add the Mazze Testnet to Metamask.

  • Have some test MAZZE tokens in your account to pay for gas fees. You can obtain these from our Testnet Faucet: faucet.mazze.io [soon]

Step 1: Setting Up Your Development Environment

Using Truffle

  1. Install Truffle Install Truffle globally on your machine if you haven't already:

    npm install -g truffle
  2. Initialize a New Truffle Project

    mkdir MyDapp && cd MyDapp
    truffle init
  3. Configure Truffle to Use Mazze Testnet Edit truffle-config.js to add the Mazze Testnet configuration:

    module.exports = {
      networks: {
        mazze-testnet: {
          provider: () => new HDWalletProvider(process.env.MNEMONIC, "https://testnet-rpc.mazze.io"),
          network_id: 199991,
          gas: 5500000,        // Gas limit used for deploys
          confirmations: 2,    // # of confs to wait between deployments
          timeoutBlocks: 200,  // # of blocks before a deployment times out
          skipDryRun: true     // Skip dry run before migrations? (default: false for public nets)
        },
      },
      // Other configurations...
    };

Using Hardhat

  1. Install Hardhat Set up a new Hardhat project if you haven't already:

  2. Create a Hardhat Project

  3. Configure Hardhat to Connect to Mazze Testnet Modify hardhat.config.js:

Step 2: Writing Your Smart Contract

Create a simple smart contract. Here's an example of a simple storage contract in Solidity:

Step 3: Deploying Your Smart Contract

Deploy your contract using Truffle or Hardhat:

Using Truffle

Create a migration file and deploy your contract:

Run the migration:

Using Hardhat

Deploy your contract with a script:

Run the deployment script:

Step 4: Interacting with Your Deployed Contract

After deploying, you can interact with your contract through scripts or frontend applications.

Last updated

Was this helpful?