DEV Community

Jeffrey.Feillp
Jeffrey.Feillp

Posted on

Zero to Web3: Writing Your First Smart Contract (1778139096)

Zero to Web3: Writing Your First Smart Contract

Deploy Your First Contract in 5 Minutes

The Contract

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

contract HelloWeb3 {
    string public message;

    constructor(string memory _msg) {
        message = _msg;
    }

    function update(string memory _msg) public {
        message = _msg;
    }
}
Enter fullscreen mode Exit fullscreen mode

Deploy with Remix

  1. Open remix.ethereum.org
  2. Paste the code
  3. Compile (Ctrl+S)
  4. Deploy to testnet
  5. Call message() to verify

Full Tutorial Series

We publish free Solidity tutorials weekly. Check our GitHub for production-ready examples.


Powered by Tianka Web3 Engine

Donate (USDT TRC-20): TU8NBT5iGyMNkLwWmWmgy7tFMbKnafLHcu

Top comments (0)