How Developers Can Deploy SQMU Smart Contracts on Any EVM Chain


Introduction

The SQMU protocol is built to be chain‑agnostic. Its smart contracts are written in Solidity and designed to run on any Ethereum Virtual Machine (EVM) compatible blockchain. Whether you are deploying on Ethereum mainnet, a layer‑2 network like Arbitrum or Base, or a testnet for experimentation, the process follows the same principles. This flexibility allows developers, property owners, and platforms to choose the chain that best suits their gas costs, user base, and strategic goals.

This article provides a comprehensive guide to deploying the core SQMU contracts—SQMU.solAtomicSQMUDistributor.sol, and SQMUTrade.sol—on any EVM chain. It covers environment setup, configuration, deployment scripts, testing, and post‑deployment verification. By the end, you will have a running instance of the SQMU standard, ready to tokenise properties by the square metre.

For an overview of the open‑source codebase, see the SQMU open‑source documentation. For the philosophical foundation of the 1 m² standard, refer to the SQMU Standard pillar page.


Prerequisites

Before deploying, ensure you have the following:

  • Node.js (v16 or later) and npm installed.
  • Git to clone the repository.
  • wallet with private key (for mainnet deployments) or a testnet wallet funded with native tokens (ETH, ARB, etc.) for testnets.
  • RPC endpoint for the target chain (e.g., from Infura, Alchemy, or a public provider).
  • Basic familiarity with Solidity, Hardhat, and Ethereum transactions.

The SQMU repository includes a Hardhat configuration that supports multiple networks out of the box.


Step 1: Clone the Repository and Install Dependencies

Start by cloning the SQMU GitHub repository and installing the required packages.

bash

git clone https://github.com/NP-Vincent/SQMU.git
cd SQMU/SQMU
npm install

The repository is structured as a Hardhat project, with contracts in contracts/, deployment scripts in scripts/, and test files in test/.


Step 2: Configure the Deployment Environment

The Hardhat configuration file (hardhat.config.js) defines the networks you can deploy to. Open it and add your network settings.

For example, to deploy on Arbitrum One:

javascript

module.exports = {
  solidity: "0.8.19",
  networks: {
    arbitrum: {
      url: "https://arb1.arbitrum.io/rpc",
      accounts: [process.env.PRIVATE_KEY],
      chainId: 42161,
    },
    base: {
      url: "https://mainnet.base.org",
      accounts: [process.env.PRIVATE_KEY],
      chainId: 8453,
    },
    scroll: {
      url: "https://rpc.scroll.io",
      accounts: [process.env.PRIVATE_KEY],
      chainId: 534352,
    },
    // Testnets
    arbitrumSepolia: {
      url: "https://sepolia-rollup.arbitrum.io/rpc",
      accounts: [process.env.PRIVATE_KEY],
      chainId: 421614,
    },
    baseSepolia: {
      url: "https://sepolia.base.org",
      accounts: [process.env.PRIVATE_KEY],
      chainId: 84532,
    },
  },
};

Store your private key in a .env file (never commit it). Use dotenv to load it:

javascript

require("dotenv").config();
const PRIVATE_KEY = process.env.PRIVATE_KEY;

Step 3: Understand the Core Contracts

The three main contracts you will deploy are:

  • SQMU.sol – The ERC‑1155 token contract. For each property, you will deploy a separate instance (or use a single instance with multiple token IDs). This contract manages the ownership ledger.
  • AtomicSQMUDistributor.sol – Handles primary sales. It interacts with SQMU.sol to transfer tokens atomically upon payment.
  • SQMUTrade.sol – Provides secondary market functionality with whitelist controls.

In a typical deployment, you first deploy SQMU.sol for a property, then deploy AtomicSQMUDistributor.sol and optionally SQMUTrade.sol linked to that token contract.


Step 4: Write a Deployment Script

Create a deployment script in the scripts/ directory, e.g., deploy.js. Below is a basic script that deploys SQMU.sol and configures it for a property.

javascript

const hre = require("hardhat");

async function main() {
  const [deployer] = await hre.ethers.getSigners();
  console.log("Deploying contracts with account:", deployer.address);

  // Define property metadata
  const propertyName = "Example Tower";
  const propertySymbol = "ETWR";
  const totalSupply = 1000; // 1000 m²
  const baseURI = "ipfs://Qm..."; // Metadata URI

  // Deploy SQMU contract
  const SQMU = await hre.ethers.getContractFactory("SQMU");
  const sqmu = await SQMU.deploy(propertyName, propertySymbol, totalSupply, baseURI);
  await sqmu.deployed();
  console.log("SQMU deployed to:", sqmu.address);

  // Optionally deploy distributor
  const Distributor = await hre.ethers.getContractFactory("AtomicSQMUDistributor");
  const distributor = await Distributor.deploy(sqmu.address);
  await distributor.deployed();
  console.log("Distributor deployed to:", distributor.address);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

For more advanced setups, you can deploy a single SQMU contract with multiple token IDs (using ERC‑1155) to represent a portfolio. The repository includes example scripts for that pattern.


Step 5: Run the Deployment

Execute the script on your chosen network. For a testnet:

bash

npx hardhat run scripts/deploy.js --network arbitrumSepolia

For mainnet:

bash

npx hardhat run scripts/deploy.js --network arbitrum

After deployment, the script will output the contract addresses. Save them; you will need them for the WordPress plugin or for integrations.


Step 6: Verify the Contracts on Block Explorers

Verifying contracts makes the source code publicly readable and allows users to interact with them via explorers like Arbiscan or Basescan. Hardhat supports automatic verification via plugins.

Install the verification plugin:

bash

npm install --save-dev @nomicfoundation/hardhat-verify

Add the plugin to hardhat.config.js and configure API keys for each explorer.

Then run:

bash

npx hardhat verify --network arbitrum <contract-address> <constructor-arguments>

Verification ensures transparency and builds trust with investors and regulators.


Step 7: Configure the WordPress Plugin (Optional)

If you are using the SQMU WordPress plugin to manage listings and investor dashboards, you will need to update the plugin settings with your deployed contract addresses. The plugin’s admin panel accepts network and contract details, allowing you to connect your WordPress site directly to your deployed contracts.

For detailed plugin setup, refer to the open‑source WordPress plugin documentation.


Step 8: Test the Deployment

Before opening the property to investors, perform thorough testing on a testnet. The repository includes a comprehensive test suite. Run it with:

bash

npx hardhat test

You can also write custom scripts to simulate purchases, transfers, and compliance checks.


Compatibility Across EVM Chains

The SQMU contracts are written in Solidity 0.8.x and have been tested on:

  • Ethereum (mainnet, Sepolia)
  • Arbitrum (One, Nova, Sepolia)
  • Base (mainnet, Sepolia)
  • Scroll (mainnet, Sepolia)
  • Polygon (mainnet, Mumbai)

Because they rely only on standard EVM opcodes and ERC‑1155 functionality, they should work on any chain with a compatible EVM. Gas costs vary; layer‑2 networks like Arbitrum and Base offer significantly lower fees, making them attractive for high‑volume transactions.


Best Practices for Production Deployments

  • Use a dedicated deployer account with a secure private key stored in a hardware wallet or encrypted environment.
  • Perform a security audit before mainnet deployment. The open‑source code can be audited by independent firms; consider using audit services that specialise in real‑asset tokenisation.
  • Implement administrative controls (e.g., multi‑signature for ownership functions) to prevent unauthorised changes.
  • Set up monitoring for contract events to track minting, transfers, and distributor activities.
  • Document your deployment with contract addresses, transaction hashes, and verification links for transparency.

Customising for Compliance

Each jurisdiction may require specific transfer restrictions, KYC/AML controls, or investor qualifications. The SQMU contracts are modular and can be extended to incorporate these requirements. For example, you can:

  • Add a whitelist modifier that restricts transfers to approved addresses.
  • Integrate with a third‑party KYC provider that updates the whitelist via an oracle.
  • Use a proxy pattern to allow upgradeable compliance rules.

For region‑specific guidance, refer to our detailed analyses:


Conclusion

Deploying SQMU smart contracts on any EVM chain is a straightforward process that empowers developers to create compliant, transparent, and scalable real estate tokenisation platforms. By following the steps outlined in this guide—cloning the repository, configuring the network, writing deployment scripts, and verifying contracts—you can launch a property tokenisation solution tailored to your needs.

The open‑source nature of SQMU ensures that you have full control over your deployment, with the ability to inspect, modify, and extend the code as required. Whether you are tokenising a single villa or a global portfolio, the SQMU standard provides a solid foundation.

For further assistance or custom deployment support, consulting services are available to help with contract customisation, compliance integration, and launch strategies.


Further Reading


Leave a Reply

Reset password

Enter your email address and we will send you a link to change your password.

Get started with your account

to save your favourite homes and more

Sign up with email

Get started with your account

to save your favourite homes and more

Create an agent account

Manage your listings, profile and more

Phone

Buyers will use it to contact you.

Create an agent account

Manage your listings, profile and more

Sign up with email