square-codeDeploy Your Contract (Remix)

Deploy Your First Contract (Remix)

This guide shows how to deploy a simple Solidity contract to SATUCHAIN Testnet using Remix and MetaMask.

Requirements

Step 1 — Create a Contract in Remix

  1. In the left sidebar, open File Explorers.

  2. Create a new file: Storage.sol

  3. Paste the contract below:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Storage {
    uint256 private value;

    event ValueChanged(uint256 newValue);

    function set(uint256 newValue) external {
        value = newValue;
        emit ValueChanged(newValue);
    }

    function get() external view returns (uint256) {
        return value;
    }
}

Step 2 — Compile the Contract

  1. Open the Solidity Compiler tab (left sidebar).

  2. Select compiler version 0.8.20 (or any 0.8.x that matches the pragma).

  3. Click Compile Storage.sol.

  4. Ensure there are no errors.

Step 3 — Connect Remix to MetaMask (Injected Provider)

  1. Open the Deploy & Run Transactions tab.

  2. In Environment, select Injected Provider - MetaMask.

  3. MetaMask will prompt you to connect Remix. Approve it.

  4. Confirm MetaMask shows you are on SATUCHAIN Testnet.

Step 4 — Deploy

  1. In Remix, make sure the contract dropdown shows Storage.

  2. Click Deploy.

  3. MetaMask will pop up with the deployment transaction:

    • Review gas fee (paid in tSTU)

    • Click Confirm

  4. Wait until the transaction is mined.

After success, the deployed contract appears under Deployed Contracts in Remix.

Step 5 — Interact With the Contract

  1. Expand the deployed Storage contract in Remix.

  2. Call get to read the current value (default is 0).

  3. In set, enter a number (example: 123) and click set.

  4. Confirm the transaction in MetaMask.

  5. Call get again to confirm the value changed.

Step 6 — Verify on the Explorer

  1. Copy the deployment transaction hash from MetaMask (or from Remix console).

  2. Search the Tx Hash to confirm:

    • Status: Success

    • Contract creation

    • Deployed contract address

Optional: search the contract address directly to view transactions and logs.

Troubleshooting

“Injected Provider” not available

  • Install MetaMask and refresh Remix.

  • Make sure the browser allows pop-ups.

Deployment fails / out of gas

  • Ensure you have enough tSTU.

  • Try deploying again with a smaller contract or accept the default gas estimate.

Wrong network

  • Switch MetaMask to SATUCHAIN Testnet and reload Remix, then reconnect “Injected Provider - MetaMask”.

Last updated