3分钟Solidity: 1.1 Hello World

29 阅读1分钟

编程惯例,先写个hello world

// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.26 and less than 0.9.0
pragma solidity ^0.8.26;

contract HelloWorld {
    string public greet = "Hello World!";
}

pragma 指定了 Solidity 的编译器版本。

在Remix Lite上部署运行:

点击这里尝试

如下图,点击Deploy contract

Remix Lite--hello_world

点击Deploy contract后,显示greet的值 Remix Lite--hello_world--Deploy


END