Menu

Post image 1
Post image 2
1 / 2
0

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

DEV Community·Jeffrey.Feillp·25 days ago
#3Z1Xjzgx
Reading 0:00
15s threshold

Jeffrey.Feillp

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

Read More